Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 58ca629

Browse files
committed
doc tweaks
1 parent 60b88e5 commit 58ca629

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

features/filtering/inclusion_filters.feature

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
Feature: inclusion filters
22

3-
You can restrict which examples are run by declaring an inclusion filter. The
3+
You can constrain which examples are run by declaring an inclusion filter. The
44
most common use case is to focus on a subset of examples as you're focused on
55
a particular problem.
66

7-
If you set the `treat_symbols_as_metadata_keys_with_true_values` config option
8-
to `true`, you can specify metadata using only symbols.
7+
You can specify metadata using only symbols if you set the
8+
`treat_symbols_as_metadata_keys_with_true_values` config option to `true`.
99

1010
Background:
1111
Given a file named "spec/spec_helper.rb" with:
1212
"""
1313
RSpec.configure do |c|
14-
# filter_run is short-form alias for filter_run_including
15-
c.filter_run :focus => true
14+
c.filter_run_including :focus => true
1615
end
1716
"""
1817

features/hooks/filtering.feature

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
Feature: filters
22

3-
`before`/`after`/`around` hooks defined in the RSpec configuration block can
4-
be filtered using metadata. Arbitrary metadata can be applied to an example
5-
or example group, and used to make a hook only apply to examples with the
6-
given metadata.
3+
`before`, `after`, and `around` hooks defined in the block passed to
4+
`RSpec.configure` can be constrained to specific examples and/or groups using
5+
metadata as a filter.
76

8-
If you set the `treat_symbols_as_metadata_keys_with_true_values` config option
9-
to `true`, you can specify metadata using only symbols.
7+
RSpec.configure do |c|
8+
c.before(:each, :type => :model) do
9+
# ...
10+
end
11+
end
12+
13+
describe "something", :type => :model do
14+
# ...
15+
end
16+
17+
You can specify metadata using only symbols if you set the
18+
`treat_symbols_as_metadata_keys_with_true_values` config option to `true`.
1019

1120
Scenario: filter `before(:each)` hooks using arbitrary metadata
1221
Given a file named "filter_before_each_hooks_spec.rb" with:

0 commit comments

Comments
 (0)