From 80eaf4d64e0545c504353c47e214219c65b81b9c Mon Sep 17 00:00:00 2001 From: Julien Biezemans Date: Thu, 23 Feb 2012 00:40:24 +0100 Subject: [PATCH] Add "around hooks" stepdefs --- step_definitions/cucumber_stepdefs.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/step_definitions/cucumber_stepdefs.rb b/step_definitions/cucumber_stepdefs.rb index 679d01b..ed178dd 100644 --- a/step_definitions/cucumber_stepdefs.rb +++ b/step_definitions/cucumber_stepdefs.rb @@ -62,6 +62,10 @@ write_passing_hook hook_type end +Given /^a passing around hook$/ do + write_passing_hook "around" +end + Given /^a scenario without any tags$/ do write_scenario end @@ -231,6 +235,14 @@ end end +Then /^the around hook fires around the scenario$/ do + assert_cycle_sequence('around-pre', 'step 1', 'around-post') +end + +Then /^the around hook is fired around the other hooks$/ do + assert_cycle_sequence('around-pre', 'before', 'step 1', 'after', 'around-post') +end + Then /^the received data table array equals the following:$/ do |json| assert_data_table_equals_json(json) end