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

Commit 361e521

Browse files
committed
Clean up docs for trigger_inclusion behaviour
Fixes #2775 Related: - #2834 - #2832 - #1762
1 parent e0f638d commit 361e521

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

features/example_groups/shared_examples.feature

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Feature: shared examples
1010
```ruby
1111
include_examples "name" # include the examples in the current context
1212
it_behaves_like "name" # include the examples in a nested context
13-
matching metadata # include the examples in the current context
1413
```
1514

1615
**WARNING:** Files containing shared groups must be loaded before the files that

lib/rspec/core/hooks.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ module Hooks
112112
#
113113
# ### Warning: implicit before blocks
114114
#
115-
# `before` hooks can also be declared in shared contexts which get
116-
# included implicitly either by you or by extension libraries. Since
117-
# RSpec runs these in the order in which they are declared within each
115+
# `before` hooks can also be declared in configuration-level shared contexts
116+
# which get included implicitly either by you or by extension libraries.
117+
# Since RSpec runs these in the order in which they are declared within each
118118
# scope, load order matters, and can lead to confusing results when one
119119
# before block depends on state that is prepared in another before block
120120
# that gets run later.

lib/rspec/core/shared_example_group.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@ def include_in(klass, inclusion_line, args, customization_block)
4545
# examples that you wish to use in multiple example groups.
4646
#
4747
# When defined, the shared group block is stored for later evaluation.
48-
# It can later be included in an example group either explicitly
49-
# (using `include_examples`, `include_context` or `it_behaves_like`)
50-
# or implicitly (via matching metadata).
48+
# It can later be included in an example group explicitly using
49+
# `include_examples`, `include_context` or `it_behaves_like`.
5150
#
5251
# Named shared example groups are scoped based on where they are
5352
# defined. Shared groups defined in an example group are available
@@ -62,9 +61,7 @@ module SharedExampleGroup
6261
# @overload shared_examples(name, metadata, &block)
6362
# @param name [String, Symbol, Module] identifer to use when looking up
6463
# this shared group
65-
# @param metadata [Array<Symbol>, Hash] metadata to attach to this
66-
# group; any example group or example with matching metadata will
67-
# automatically include this shared example group.
64+
# @param metadata [Array<Symbol>, Hash] metadata to attach to this group
6865
# @param block The block to be eval'd
6966
#
7067
# Stores the block for later use. The block will be evaluated

0 commit comments

Comments
 (0)