test_oof v0.1.0 TestOof View Source

TestOof: A tiny test helper tool to make sure all your test files run.

Why

I'm an idiot. As an idiot, I often will write tests that I think are great and the whole suite passes and I feel great about myself. Only later—sometimes much later— do I notice the compiler warning that one of my beautiful tests has the .ex extenion and not the .exs extension that ExUnit requires to run the test.

This package is an attempt to remove that rake I tend to step on.

How it works

TestOof assumes that all files in your test directory (the location of which you can override) that end in _test are indeed ExUnit test files. TestOof gathers files matching that criteria and filters that list down to files whose extension is anything other than .exs. If there are any files left after filter, TestOof raises and lists all offenders.

  • Could it be more efficient? Certainly.
  • Will it stop me from making the mistake of assuming test are running when the actually aren't? Possibly

Link to this section Summary

Functions

Given a location of test files, recursively collect all files whose name ends with _test and then filter out all files that end with .exs. If any files remain, raise the WrongFileExtensionError exception

Link to this section Functions

Link to this function

ensure_test_files_are_exs!(dir \\ File.cwd!() <> "/test") View Source
ensure_test_files_are_exs!(String.t()) :: :ok | no_return()

Given a location of test files, recursively collect all files whose name ends with _test and then filter out all files that end with .exs. If any files remain, raise the WrongFileExtensionError exception.