This repository has been archived by the owner on Nov 30, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 760
Clean up documentation leftovers for trigger_inclusion behaviour #2878
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JonRowe
approved these changes
Mar 3, 2021
I love those short examples @pirj :) |
yujinakayama
pushed a commit
to yujinakayama/rspec-monorepo
that referenced
this pull request
Oct 19, 2021
…rigger_inclusion-related-docs Clean up documentation leftovers for trigger_inclusion behaviour --- This commit was imported from rspec/rspec-core@fa0a149.
pirj
added a commit
to rubocop/rubocop-rspec
that referenced
this pull request
Jul 9, 2022
Starting from RSpec 4, the implicit shared context inclusion, when a shared context would have been included to an example if the example has matching metadata, is not the case anymore. See: - rspec/rspec-core#2834 - rspec/rspec-core#2832 - rspec/rspec-core#2878
pirj
added a commit
to rubocop/rubocop-rspec
that referenced
this pull request
Jul 9, 2022
Starting from RSpec 4, the implicit shared context inclusion, when a shared context would have been included to an example if the example has matching metadata, is not the case anymore. See: - rspec/rspec-core#2834 - rspec/rspec-core#2832 - rspec/rspec-core#2878
pirj
added a commit
to rubocop/rubocop-rspec
that referenced
this pull request
Jul 9, 2022
Starting from RSpec 4, the implicit shared context inclusion, when a shared context would have been included to an example if the example has matching metadata, is not the case anymore. See: - rspec/rspec-core#2834 - rspec/rspec-core#2832 - rspec/rspec-core#2878
pirj
added a commit
to rubocop/rubocop-rspec
that referenced
this pull request
Jul 10, 2022
Starting from RSpec 4, the implicit shared context inclusion, when a shared context would have been included to an example if the example has matching metadata, is not the case anymore. See: - rspec/rspec-core#2834 - rspec/rspec-core#2832 - rspec/rspec-core#2878
Merged
5 tasks
This was referenced Oct 24, 2022
pirj
added a commit
to rubocop/rubocop-capybara
that referenced
this pull request
Dec 29, 2022
Starting from RSpec 4, the implicit shared context inclusion, when a shared context would have been included to an example if the example has matching metadata, is not the case anymore. See: - rspec/rspec-core#2834 - rspec/rspec-core#2832 - rspec/rspec-core#2878
ydah
pushed a commit
to rubocop/rubocop-factory_bot
that referenced
this pull request
Apr 13, 2023
Starting from RSpec 4, the implicit shared context inclusion, when a shared context would have been included to an example if the example has matching metadata, is not the case anymore. See: - rspec/rspec-core#2834 - rspec/rspec-core#2832 - rspec/rspec-core#2878
ydah
pushed a commit
to rubocop/rubocop-rspec_rails
that referenced
this pull request
Mar 27, 2024
Starting from RSpec 4, the implicit shared context inclusion, when a shared context would have been included to an example if the example has matching metadata, is not the case anymore. See: - rspec/rspec-core#2834 - rspec/rspec-core#2832 - rspec/rspec-core#2878
ydah
pushed a commit
to rubocop/rubocop-rspec_rails
that referenced
this pull request
Mar 27, 2024
Starting from RSpec 4, the implicit shared context inclusion, when a shared context would have been included to an example if the example has matching metadata, is not the case anymore. See: - rspec/rspec-core#2834 - rspec/rspec-core#2832 - rspec/rspec-core#2878
pirj
added a commit
to rubocop/rubocop-rspec_rails
that referenced
this pull request
Aug 9, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2775
Related:
shared_context_metadata_behavior
#2832To sum it all up, the current behavior (
apply_to_host_groups
) is:1.1. Configuration-level methods (
include
,extend
,prepend
,include_context
,before
,after
,around
) are tagged with metadata that is matched against example group metadata (and example metadata, as an example has a singleton example group), and are included. E.g.:1.2. Example group-level methods' (
shared_examples
/shared_examples_for
,shared_context
) metadata is applied to host groups that explicitly include them. E.g.:1.3. Example group-level methods' (
shared_examples
/shared_examples_for
,shared_context
) do not include shared groups to example groups based on matching metadata. E.g.:1.4 Example group-level hook methods are executed for examples with matching metadata. E.g.:
Just to avoid any confusion:
2.1. Configuration-level methods
shared_context
/shared_examples
/shared_examples_for
are not defined2.2. Configuration-level methods
include_examples
/it_behaves_like
are not defined2.3. Example group-level
include_context
/include_examples
/it_behaves_like
(as opposed to configuration-level counterparts) do not accept metadata, but rather parameters that are passed to the included shared group:Quite obvious but confused me:
3.1. Included example groups override memoized helpers defined in the including example group: