Skip to content

Commit

Permalink
--example option test for nested groups
Browse files Browse the repository at this point in the history
  • Loading branch information
iromeo authored and dchelimsky committed Jun 19, 2010
1 parent 4594bc2 commit ea08d2e
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions features/command_line/example_name_option.feature
Expand Up @@ -24,18 +24,28 @@ Feature: example name option
it "second example in second group" do; end
end
"""
Given a file named "third_spec.rb" with:
"""
describe "third group" do
it "first example in third group" do; end
context "nested group" do
it "first example in nested group" do; end
it "second example in nested group" do; end
end
end
"""

Scenario: no matches
When I run "rspec . --example nothing_like_this"
Then I should see "0 examples, 0 failures"

Scenario: match on one word
When I run "rspec . --example example"
Then I should see "4 examples, 0 failures"
Then I should see "7 examples, 0 failures"

Scenario: one match in each file
Scenario: one match in each context
When I run "rspec . --example 'first example'"
Then I should see "2 examples, 0 failures"
Then I should see "4 examples, 0 failures"

Scenario: one match in one file using just the example name
When I run "rspec . --example 'first example in first group'"
Expand All @@ -56,3 +66,7 @@ Feature: example name option
Scenario: one match in one file with group name
When I run "rspec . --example 'second group first example'"
Then I should see "1 example, 0 failures"

Scenario: all examples in one group including examples in nested groups
When I run "rspec . --example 'third group'"
Then I should see "3 examples, 0 failures"

0 comments on commit ea08d2e

Please sign in to comment.