-
Notifications
You must be signed in to change notification settings - Fork 20
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
NBehave.Narrator.Framework.Hooks.BeforeScenario is not picked up #13
Comments
If you could give me a repro it would be awesome because what I tried worked as intended. Here is the code i used:
feature file:
|
This happens because now a HooksAttribute is required as well as an ActionStepsAttribute. Previously this additional attribute wasn't required at the class level. |
That said there is definitely a bug here. Using the embeddedrunner, executetext, it instanciates the helper class twice, once when calling the hooks (methodhookmetadata.methodhookmetadata) and then again in actionstateparser.findactionstatemethods. It seems the instance that got tested was a different instance to the one the BeforeScenario hook was executed on. |
Scratch that, there's no bug. The double instantiation is to ensure you're using ScenarioContext.Current for your state rather than instance variables in your helper class. Also I note that parameter names in the step functions must now match the $ name. All good changes - just trip people up who are upgrading old tests. |
The double instancing doesn't sound lso great. Maybe someone should fix that :-) |
When i use NBehave.Narrator.Framework.BeforeScenario the method is executed, but not when i use NBehave.Narrator.Framework.Hooks.BeforeScenario.
This is via command runner.
The text was updated successfully, but these errors were encountered: