This repository was archived by the owner on Nov 30, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 755
Auto-included shared contexts are not subject to the same scoping rules that manually included ones are #1762
Milestone
Comments
👍 |
The change discussed in #1790 will solve this and I'm pretty sold on that, so I'm going to close this issue in favor of that one. |
myronmarston
added a commit
that referenced
this issue
Jun 5, 2016
Previously, it always triggered auto-inclusion based on matching metadata. The option allows you to opt-in to having it add the metadata to included groups and examples instead. - Closes #1790 (this is the last thing necessary for it). - Addresses #1762. - Addresses user confusion reported in: - rspec/rspec-rails#1241 - rspec/rspec-rails#1579
myronmarston
added a commit
that referenced
this issue
Jun 5, 2016
Previously, it always triggered auto-inclusion based on matching metadata. The option allows you to opt-in to having it add the metadata to included groups and examples instead. - Closes #1790 (this is the last thing necessary for it). - Addresses #1762. - Addresses user confusion reported in: - rspec/rspec-rails#1241 - rspec/rspec-rails#1579
myronmarston
added a commit
that referenced
this issue
Jun 5, 2016
Previously, it always triggered auto-inclusion based on matching metadata. The option allows you to opt-in to having it add the metadata to included groups and examples instead. - Closes #1790 (this is the last thing necessary for it). - Addresses #1762. - Addresses user confusion reported in: - rspec/rspec-rails#1241 - rspec/rspec-rails#1579
myronmarston
added a commit
that referenced
this issue
Jun 5, 2016
Previously, it always triggered auto-inclusion based on matching metadata. The option allows you to opt-in to having it add the metadata to included groups and examples instead. - Closes #1790 (this is the last thing necessary for it). - Addresses #1762. - Addresses user confusion reported in: - rspec/rspec-rails#1241 - rspec/rspec-rails#1579
myronmarston
added a commit
that referenced
this issue
Jun 5, 2016
Previously, it always triggered auto-inclusion based on matching metadata. The option allows you to opt-in to having it add the metadata to included groups and examples instead. - Closes #1790 (this is the last thing necessary for it). - Addresses #1762. - Addresses user confusion reported in: - rspec/rspec-rails#1241 - rspec/rspec-rails#1579
myronmarston
added a commit
that referenced
this issue
Jun 5, 2016
Previously, it always triggered auto-inclusion based on matching metadata. The option allows you to opt-in to having it add the metadata to included groups and examples instead. - Closes #1790 (this is the last thing necessary for it). - Addresses #1762. - Addresses user confusion reported in: - rspec/rspec-rails#1241 - rspec/rspec-rails#1579
MatheusRich
pushed a commit
to MatheusRich/rspec-core
that referenced
this issue
Oct 30, 2020
Previously, it always triggered auto-inclusion based on matching metadata. The option allows you to opt-in to having it add the metadata to included groups and examples instead. - Closes rspec#1790 (this is the last thing necessary for it). - Addresses rspec#1762. - Addresses user confusion reported in: - rspec/rspec-rails#1241 - rspec/rspec-rails#1579
pirj
added a commit
that referenced
this issue
Mar 1, 2021
yujinakayama
pushed a commit
to yujinakayama/rspec-monorepo
that referenced
this issue
Oct 19, 2021
Fixes rspec/rspec-core#2775 Related: - rspec/rspec-core#2834 - rspec/rspec-core#2832 - rspec/rspec-core#1762 --- This commit was imported from rspec/rspec-core@361e521.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Currently, when you define a shared example group with metadata, the implementation does this:
It delegates to
configuration.include
in order to make the shared group auto-included in example groups that have matching metadata.There's a discrepancy with the scoping rules of shared example groups, though: if the shared group is defined within a nested group it is only available for manual inclusion (using
include_context
or similar) within that group or a nested group. With the metadata auto-inclusion, the shared group would still be included in any matching example group, even if it's "out of scope" according to our manual inclusion scoping rules.We should probably address this but maybe in the 4.0 timeframe?
/cc @JonRowe
The text was updated successfully, but these errors were encountered: