From ea08d2ee52f5685afc781563dfa5ba641839ab6a Mon Sep 17 00:00:00 2001 From: Roman Chernyatchik Date: Thu, 17 Jun 2010 00:19:22 +0400 Subject: [PATCH] --example option test for nested groups --- .../command_line/example_name_option.feature | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/features/command_line/example_name_option.feature b/features/command_line/example_name_option.feature index 4f54c37bfb..80fcdba41a 100644 --- a/features/command_line/example_name_option.feature +++ b/features/command_line/example_name_option.feature @@ -24,6 +24,16 @@ 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" @@ -31,11 +41,11 @@ Feature: example name option 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'" @@ -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" \ No newline at end of file