Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

Commit

Permalink
Add some hook step definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
jbpros committed Feb 26, 2012
1 parent 8559dee commit 8c2d15f
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions step_definitions/cucumber_stepdefs.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8c2d15f

Please sign in to comment.