Cucumber: Before hook run only once for all scenarios
问题 I have a scenario outline with multiple scenarios. I'd like my Before hook to run only once so I can bootstrap the ActiveRecord objects I need to run against all of the scenarios. The problem is if I use Before do # my code here end This will execute before each Scenario. Is there anyway to run it once for the entire Outline? 回答1: I think if you simply create the objects in a file in features/support they will be persisted: ImportantThing.create(:name => "USEFUL THING") This is because before