diff --git a/features/example_groups/shared_examples.feature b/features/example_groups/shared_examples.feature index c7c8bbe4ed..4de8cd7d43 100644 --- a/features/example_groups/shared_examples.feature +++ b/features/example_groups/shared_examples.feature @@ -10,7 +10,6 @@ Feature: shared examples ```ruby include_examples "name" # include the examples in the current context it_behaves_like "name" # include the examples in a nested context - matching metadata # include the examples in the current context ``` **WARNING:** Files containing shared groups must be loaded before the files that diff --git a/lib/rspec/core/hooks.rb b/lib/rspec/core/hooks.rb index f8bad18f51..e8fdb7d38a 100644 --- a/lib/rspec/core/hooks.rb +++ b/lib/rspec/core/hooks.rb @@ -112,9 +112,9 @@ module Hooks # # ### Warning: implicit before blocks # - # `before` hooks can also be declared in shared contexts which get - # included implicitly either by you or by extension libraries. Since - # RSpec runs these in the order in which they are declared within each + # `before` hooks can also be declared in configuration-level shared contexts + # which get included implicitly either by you or by extension libraries. + # Since RSpec runs these in the order in which they are declared within each # scope, load order matters, and can lead to confusing results when one # before block depends on state that is prepared in another before block # that gets run later. diff --git a/lib/rspec/core/shared_example_group.rb b/lib/rspec/core/shared_example_group.rb index 4871d3f940..b79afcfbc9 100644 --- a/lib/rspec/core/shared_example_group.rb +++ b/lib/rspec/core/shared_example_group.rb @@ -45,9 +45,8 @@ def include_in(klass, inclusion_line, args, customization_block) # examples that you wish to use in multiple example groups. # # When defined, the shared group block is stored for later evaluation. - # It can later be included in an example group either explicitly - # (using `include_examples`, `include_context` or `it_behaves_like`) - # or implicitly (via matching metadata). + # It can later be included in an example group explicitly using + # `include_examples`, `include_context` or `it_behaves_like`. # # Named shared example groups are scoped based on where they are # defined. Shared groups defined in an example group are available @@ -62,9 +61,7 @@ module SharedExampleGroup # @overload shared_examples(name, metadata, &block) # @param name [String, Symbol, Module] identifer to use when looking up # this shared group - # @param metadata [Array, Hash] metadata to attach to this - # group; any example group or example with matching metadata will - # automatically include this shared example group. + # @param metadata [Array, Hash] metadata to attach to this group # @param block The block to be eval'd # # Stores the block for later use. The block will be evaluated