diff --git a/step_definitions/cucumber_stepdefs.rb b/step_definitions/cucumber_stepdefs.rb index 9c8ce47..989486e 100644 --- a/step_definitions/cucumber_stepdefs.rb +++ b/step_definitions/cucumber_stepdefs.rb @@ -59,11 +59,15 @@ end Given /^a passing (before|after) hook$/ do |hook_type| - write_passing_hook hook_type + write_passing_hook :type => hook_type end Given /^a passing around hook$/ do - write_passing_hook "around" + write_passing_hook :type => "around" +end + +Given /^a hook tagged with "([^"]*)"$/ do |tag| + write_passing_hook :tags => [tag] end Given /^a scenario without any tags$/ do @@ -95,6 +99,11 @@ run_feature end +When /^Cucumber executes a scenario tagged with "([^"]*)"$/ do |tag| + write_scenario :with_tags => [tag] + run_feature +end + When /^Cucumber runs the scenario with steps for a calculator$/ do write_calculator_code write_mappings_for_calculator @@ -243,6 +252,10 @@ assert_cycle_sequence('around-pre', 'before', 'step 1', 'after', 'around-post') end +Then /^the hook is fired$/ do + assert_cycle_sequence("hook") +end + Then /^the received data table array equals the following:$/ do |json| assert_data_table_equals_json(json) end