From 6438302cc8468ccd3da366e0945f4cbedd926b5a Mon Sep 17 00:00:00 2001 From: Steve Tooke Date: Fri, 13 Mar 2015 13:24:18 +0000 Subject: [PATCH] Features showing issues with exceptions in hooks cc @mattwynne --- .../docs/exception_in_around_hook.feature | 25 +++++++++++++++++++ .../handle_unexpected_response.feature | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 features/docs/exception_in_around_hook.feature diff --git a/features/docs/exception_in_around_hook.feature b/features/docs/exception_in_around_hook.feature new file mode 100644 index 0000000000..2ac18b8e8e --- /dev/null +++ b/features/docs/exception_in_around_hook.feature @@ -0,0 +1,25 @@ +Feature: Exceptions in Around Hooks + + Scenario: + Given the standard step definitions + And a file named "features/support/env.rb" with: + """ + Around do |scenario, block| + fail "this should be reported" + block.call + end + """ + And a file named "features/test.feature" with: + """ + Feature: Sample + + Scenario: Run a good step + Given this step passes + Scenario: Run a good step + Given this step passes + """ + When I run `cucumber features` + Then it should fail with: + """ + this should be reported + """ diff --git a/features/docs/wire_protocol/handle_unexpected_response.feature b/features/docs/wire_protocol/handle_unexpected_response.feature index 94d65d543e..8ae2d64a2b 100644 --- a/features/docs/wire_protocol/handle_unexpected_response.feature +++ b/features/docs/wire_protocol/handle_unexpected_response.feature @@ -24,7 +24,7 @@ Feature: Handle unexpected response | ["begin_scenario"] | ["yikes"] | | ["step_matches",{"name_to_match":"we're all wired"}] | ["success",[{"id":"1", "args":[]}]] | When I run `cucumber -f pretty` - Then the stdout should contain: + Then the output should contain: """ undefined method `handle_yikes' """