Skip to content

Commit

Permalink
Down to a test failure on Scenario tagging -- as it should be
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Light committed Dec 5, 2010
1 parent fc8db0b commit 61bd422
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions lib/coulda/feature.rb
Expand Up @@ -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 ||=[]
Expand Down
18 changes: 9 additions & 9 deletions test/integration/tagged_features_and_scenarios_test.rb
Expand Up @@ -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

0 comments on commit 61bd422

Please sign in to comment.