Skip to content

Commit

Permalink
more narrative on --example option feature
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Jan 31, 2010
1 parent 0259621 commit 644e680
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions features/command_line/example_name_option.feature
@@ -1,7 +1,15 @@
Feature: example name option

Use the --example (or -e) option to filter the examples
to be run by name.
Use the --example (or -e) option to filter the examples to be run by name.

The submitted argument is compiled to a Ruby Regexp, and matched against the
full description of the example, which is the concatenation of descriptions
of the group (including any nested groups) and the example.

This allows you to run a single uniquely named example, all examples with
similar names, all the example in a uniquely named group, etc, etc.

If no matches are found, then the entire suite is run.

Background:
Given a file named "first_spec.rb" with:
Expand Down Expand Up @@ -39,6 +47,10 @@ Feature: example name option
When I run "spec . --example 'first .* first example'"
Then the stdout should match "1 example, 0 failures"

Scenario: all examples in one group
When I run "spec . --example 'first group'"
Then the stdout should match "2 examples, 0 failures"

Scenario: one match in one file with group name
When I run "spec . --example 'second group first example'"
Then the stdout should match "1 example, 0 failures"

0 comments on commit 644e680

Please sign in to comment.