back to notes

Run methods/hooks before and after Cucumber test suite

" # features/support/env.rb

My::Service.build!

at_exit do
  My::Service.tear_down!
end

Anything in features/support/env.rb gets run before the Cucumber test suite, so the first method call functions like a before suite block. at_exit is Ruby Kernel and runs when the program exits. This implementation works roughly the same as a before and after block. "

Source: https://til.hashrocket.com/posts/146bd575cb-cucumber-suite-hooks



last updated october 2016