-
Notifications
You must be signed in to change notification settings - Fork 34
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
Support setup, setup_all callbacks #71
Comments
Background should be translated to |
@hauleth Yeah, they should do the same thing. Where
From this it seems that workflow should be as follows:
|
The issue with background === setup is that this might break developer expectations. My first implementation did exactly that, but the thing is that ExUnit maintains the order that setup callbacks are defined. Given the code replacement that is happening behind the scenes, if a developer writes an explicit setup block anywhere underneath the 'using' line, their setup block will run after tags and after background steps. This is fine for tags, as they are a before/after thing which follows the Gherkin spec. But I think it would break expectations to have user defined 'setup' blocks run after the background steps. Now I would argue if you're using Cabbage you shouldn't be writing explicit (ExUnit) 'setup' blocks when you should be using background steps, but there is still something to be said for making the experience as smooth as possible and minimising surprises. |
Perhaps a good documentation with recommendations like beware if you use setup and background would fit most of the use cases (?) |
I think calling it out explicitly would definitely be a good thing, and like you said would cover most use cases. |
setup_all
-> should initialize test file scopesetup
-> should be able to setupscenario
, alternative to background.How they should be behaving together?
The text was updated successfully, but these errors were encountered: