Sha256: 1b15954f41877f2994276590d38f8234eb9858a960c76dacdbeeb7f6f21d8e2c
Contents?: true
Size: 1.45 KB
Versions: 18
Compression:
Stored size: 1.45 KB
Contents
Feature: Exception in Before Block In order to know with confidence that my before blocks have run OK As a developer I want exceptions raised in Before blocks to be handled gracefully and reported by the formatters Background: Given a standard Cucumber project directory structure And a file named "features/step_definitions/steps.rb" with: """ Given /^this step works$/ do end """ And a file named "features/support/env.rb" with: """ class SomeSetupException < Exception; end class BadStepException < Exception; end Before do raise SomeSetupException.new("I cannot even start this scenario") end """ @mri186 Scenario: Handle Exception in standard scenario step and carry on Given a file named "features/naughty_step_in_scenario.feature" with: """ Feature: Sample Scenario: Run a good step Given this step works """ When I run cucumber features Then it should fail with """ Feature: Sample Scenario: Run a good step # features/naughty_step_in_scenario.feature:3 I cannot even start this scenario (SomeSetupException) ./features/support/env.rb:4:in `Before' Given this step works # features/step_definitions/steps.rb:1 Failing Scenarios: cucumber features/naughty_step_in_scenario.feature:3 # Scenario: Run a good step 1 scenario (1 failed) 1 step (1 skipped) """
Version data entries
18 entries across 18 versions & 5 rubygems