Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixture dependencies? #17

Open
jackfirth opened this issue Nov 13, 2017 · 0 comments
Open

Fixture dependencies? #17

jackfirth opened this issue Nov 13, 2017 · 0 comments
Labels

Comments

@jackfirth
Copy link
Owner

jackfirth commented Nov 13, 2017

  • Module A defines fixture F
  • Module B defines fixture G in terms of F's current value, making G depend on F
  • Test T declares that it uses fixture G
  • Both fixtures F and G are initialized within test T

The current alternative would be to bundle the disposable underlying F with a function producing the disposable for G using disposable-chain, then providing a "compound fixture" F2+G and convenience function to get the current values of F2 and G out of the compound value. But this means that if a test uses F, and another test inside that test uses G, two instances of F will be created. Furthermore, an extra F will be created for every single fixture built on top of F.

A hidden global parameter in the fixture library that maps gensyms stored in fixtures to current values could be used to implement some sort of automatic fixture dependency system. Or maybe a fixture could wrap a function producing a disposable plus dependency fixtures? Or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant