Skip to content

Instantly share code, notes, and snippets.

@NaN1488
Last active December 16, 2015 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NaN1488/5354688 to your computer and use it in GitHub Desktop.
Save NaN1488/5354688 to your computer and use it in GitHub Desktop.
Tell Cucumber to quit after a scenario is done - if it failed.
# Tell Cucumber to quit after a scenario is done - if it failed.
# $ cucumber EXIT_WHEN_FAIL=1
# Note: Please take in account the advantage of tags when working with a specific scenario before implemebt this!
After do |s|
if s.failed? && ENV.include?('EXIT_WHEN_FAIL') && ENV['EXIT_WHEN_FAIL'] == '1'
Cucumber.wants_to_quit = true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment