|
1 | 1 | Feature: `--tag` option
|
2 | 2 |
|
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. |
4 | 5 |
|
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. |
13 | 9 |
|
14 | 10 | 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 |
16 | 12 | `~tag:value` will exclude all examples marked with `:tag => value`.
|
17 | 13 |
|
| 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 | + |
18 | 19 | To be compatible with the Cucumber syntax, tags can optionally start with an
|
19 | 20 | `@` symbol, which will be ignored.
|
20 | 21 |
|
|
0 commit comments