TestOof

CircleCI

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 extension and not the .exs extenion 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.

Installation

When available in Hex, the package can be installed by adding test_oof to your list of dependencies in mix.exs:

def deps do
  [
    {:test_oof, "~> 0.2.0", only: :test}
  ]
end

Then add the following to your test_helper.exs

TestOof.ensure_test_files_are_exs!()

Configuration

test_oof supports the following options as configuration:

Documentation can be found at https://hexdocs.pm/test_oof.

Development

Run the tests

$ mix test

Or run the linter and tests combined:

$ make test

Run the linter

$ make lint

Roadmap

License

MIT. See LICENSE.