obmarg / ex_unit_fixtures

A library for defining modular dependencies (fixtures) for ExUnit tests.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AutoImport strategies

obmarg opened this issue · comments

The autoimporting code defined in #10 could possibly have configurable "import strategies":

  1. We could change the way "parent" fixture modules are found - maybe any fixture module found in the parent directories could be used, instead of just the ones named fixtures.exs. This way if anyone wants to change the name of their fixture files they only need to change the call to load_fixture_files rather than also changing the autoimport rules.
  2. We could also support directories of fixture files somehow. (So any fixtures.exs & fixtures/*.exs files are loaded).
  3. We could use the module name heirarchy instead of the filesystem hiearachy for finding fixtures. So if our test module was Project.Users.UserTest we'd pull in any fixtures from Project.Fixtures, Project.Users.Fixtures etc. etc. This could be combined with something similar to suggestion 1.

These aren't neccesarily solid gold plans, just options to think about

Definitely liking the idea of using the module heirarchy to load in fixture files...