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

Commit

Permalink
Simplify tag-related mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
jbpros committed Feb 24, 2012
1 parent 80eaf4d commit 8559dee
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions step_definitions/cucumber_stepdefs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,35 +145,35 @@
end

When /^Cucumber executes scenarios tagged with "([^"]*)"$/ do |tag|
run_feature_with_tag_groups [[tag]]
run_feature_with_tags tag
end

When /^Cucumber executes scenarios not tagged with "([^"]*)"$/ do |tag|
run_feature_with_tag_groups [["~#{tag}"]]
run_feature_with_tags "~#{tag}"
end

When /^Cucumber executes scenarios tagged with "([^"]*)" or "([^"]*)"$/ do |tag1, tag2|
run_feature_with_tag_groups [[tag1, tag2]]
run_feature_with_tags "#{tag1},#{tag2}"
end

When /^Cucumber executes scenarios tagged with both "([^"]*)" and "([^"]*)"$/ do |tag1, tag2|
run_feature_with_tag_groups [[tag1], [tag2]]
run_feature_with_tags tag1, tag2
end

When /^Cucumber executes scenarios not tagged with "([^"]*)" nor "([^"]*)"$/ do |tag1, tag2|
run_feature_with_tag_groups [["~#{tag1}"], ["~#{tag2}"]]
run_feature_with_tags "~#{tag1}", "~#{tag2}"
end

When /^Cucumber executes scenarios not tagged with both "([^"]*)" and "([^"]*)"$/ do |tag1, tag2|
run_feature_with_tag_groups [["~#{tag1}", "~#{tag2}"]]
run_feature_with_tags "~#{tag1},~#{tag2}"
end

When /^Cucumber executes scenarios tagged with "([^"]*)" or without "([^"]*)"$/ do |tag1, tag2|
run_feature_with_tag_groups [["#{tag1}", "~#{tag2}"]]
run_feature_with_tags "#{tag1},~#{tag2}"
end

When /^Cucumber executes scenarios tagged with "([^"]*)" but not with both "([^"]*)" and "([^"]*)"$/ do |tag1, tag2, tag3|
run_feature_with_tag_groups [["#{tag1}"], ["~#{tag2}"], ["~#{tag3}"]]
run_feature_with_tags tag1, "~#{tag2}", "~#{tag3}"
end

Then /^the scenario passes$/ do
Expand Down

0 comments on commit 8559dee

Please sign in to comment.