obmarg / ex_unit_fixtures

A library for defining modular dependencies (fixtures) for ExUnit tests.
MIT License
13 stars 5 forks source link

Refactor fixture creation for greater flexibility (Fixes #31) #38

Closed obmarg closed 8 years ago

obmarg commented 8 years ago

This commit contains a fairly comprehensive refactor of the way fixtures are created - all fixtures are now created in the tests setup function, regardless of how they are scoped.

Module scoped fixtures will be stored by a FixtureStore process, which will be started for each test, and shutdown again afterwards.

This should mean that module scoped fixtures are no longer implicitly autouse, because they will only be created when they are explicitly required by a test. They will still persist throughout the rest of the run of that file, but don't think there's much I can do about that...

obmarg commented 8 years ago

This will break on_exit callbacks for module scoped fixtures right now. Probably want to come up with a solution for that before merging.

obmarg commented 8 years ago

Documentation also requires some updates:

obmarg commented 8 years ago

I'd initially hoped for the next release to be a minor release, as it was just adding new features. However, removing support for on_exit seems like it might count as a breaking change. Not majorly breaking , but breaking none-the-less.

So, the next release may end up being 1.0.0. Should try and fit some more breaking changes in if that's the case though.