diff --git a/lib/coulda/feature.rb b/lib/coulda/feature.rb index 2af870b..a12850c 100644 --- a/lib/coulda/feature.rb +++ b/lib/coulda/feature.rb @@ -43,6 +43,9 @@ def self.#{stmt}(text, &block) HERE end + def Tag(name) + end + # Creates a Scenario instance and adds it to the Feature def self.Scenario(scenario_name, &block) @scenarios ||=[] diff --git a/test/integration/tagged_features_and_scenarios_test.rb b/test/integration/tagged_features_and_scenarios_test.rb index 409f164..35dfda4 100644 --- a/test/integration/tagged_features_and_scenarios_test.rb +++ b/test/integration/tagged_features_and_scenarios_test.rb @@ -8,35 +8,35 @@ Scenario "Tagged Feature" do When "I execute Coulda requesting only a tagged feature run" do - @error = `cd tag_test; rake 'coulda:tagged_tests[tagged_feature]'` + @out = `cd tag_test; rake 'coulda:tagged_tests[tagged_feature]'` end Then "I should only execute the Scenarios in that tagged Feature" do # I'm forcing all of the executed scenarios to fail so I can just check the output - assert_equal 1, @error.scan(/RuntimeError/).count - assert_equal 1, @error.scan(/Test_tagged_feature/).count + assert_equal 1, @out.scan(/RuntimeError/).count + assert_equal 1, @out.scan(/Test_tagged_feature/).count end end Scenario "Tagged Scenarios" do When "I execute Coulda requesting only a tagged feature run" do - @error = `cd tag_test; rake 'coulda:tagged_tests[tagged_scenario]'` + @out = `cd tag_test; rake 'coulda:tagged_tests[tagged_scenario]'` end Then "I should only execute the Scenarios matching that tag" do - assert_equal 2, @error.scan(/RuntimeError/).count - assert_equal 2, @error.scan(/Test_tagged_scenario/).count + assert_equal 2, @out.scan(/RuntimeError/).count + assert_equal 2, @out.scan(/Test_tagged_scenario/).count end end Scenario "Tagged Scenarios should inherit tags from their container tagged Feature" do When "I execute Coulda requesting only a tagged feature run" do - @error = `cd tag_test; rake 'coulda:tagged_tests[tagged_feature_with_tagged_scenarios]'` + @out = `cd tag_test; rake 'coulda:tagged_tests[tagged_feature_with_tagged_scenarios]'` end Then "I should only execute the Scenarios matching that Feature's tag" do - assert_equal 3, @error.scan(/RuntimeError/).count - assert_equal 3, @error.scan(/Test_tagged_feature_with_tagged_scenarios/).count + assert_equal 3, @out.scan(/RuntimeError/).count + assert_equal 3, @out.scan(/Test_tagged_feature_with_differently_tagged_scenarios/).count end end end