Skip to content

Commit a666004

Browse files
committed
Merge pull request rspec#2090 from creature/master
Fix --tag documentation to avoid confusing "filter" references.
2 parents 039704d + fb87b66 commit a666004

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

features/command_line/tag.feature

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
Feature: `--tag` option
22

3-
Use the `--tag` (or `-t`) option to filter the examples by tags.
3+
Use the `--tag` (or `-t`) option to run examples that match a specified tag.
4+
The tag can be a simple `name` or a `name:value` pair.
45

5-
The tag can be a simple `name` or a `name:value` pair. In the first case,
6-
examples with `:name => true` will be filtered. In the second case, examples
7-
with `:name => value` will be filtered, where `value` is always a string. In
8-
both cases, `name` is converted to a symbol.
9-
10-
Filters are represented internally as a hash, which means that you can't
11-
specify multiple filters for the same key. If you try to exclude `:name => 'foo'`
12-
and `:name => 'bar'`, you will only end up excluding `:name => 'bar'`.
6+
If a simple `name` is supplied, only examples with `:name => true` will run.
7+
If a `name:value` pair is given, examples with `name => value` will run,
8+
where `value` is always a string. In both cases, `name` is converted to a symbol.
139

1410
Tags can also be used to exclude examples by adding a `~` before the tag. For
15-
example `~tag` will exclude all examples marked with `:tag => true` and
11+
example, `~tag` will exclude all examples marked with `:tag => true` and
1612
`~tag:value` will exclude all examples marked with `:tag => value`.
1713

14+
Filtering by tag uses a hash internally, which means that you can't specify
15+
multiple filters for the same key. For instance, if you try to exclude
16+
`:name => 'foo'` and `:name => 'bar'`, you will only end up excluding
17+
`:name => 'bar'`.
18+
1819
To be compatible with the Cucumber syntax, tags can optionally start with an
1920
`@` symbol, which will be ignored.
2021

0 commit comments

Comments
 (0)