Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix location filtering for example in nested group in shared group in external file #1837

Conversation

Projects
None yet
3 participants
@myronmarston
Copy link
Member

myronmarston commented Jan 8, 2015

For examples defined in an example group in a shared example group in an external file, it did not work properly because the location filtering only considered the immediate parent example group’s file path, which did not match the passed location filter. By considering all parent example group file paths, it filters properly.

Fixes #835.

Note: this commit began from a failing spec that originated with @soulcutter and was fixed up by @xaviershay.

myronmarston added some commits Jan 8, 2015

Refactor: leverage `Metadata.ascend` rather than recursing in `relava…
…nt_line_numbers`.

We also don't have to check if `metadata` is `nil`; it's not possible
to get into `relavant_line_numbers` in that case.
Fix location filtering.
For examples defined in an example group in a shared
example group in an external file, it did not work
properly because the location filtering only considered
the immediate parent example group’s file path, which
did not match the passed location filter. By considering
all parent example group file paths, it filters properly.

Fixes #835.

Note: this commit began from a failing spec that
originated with @soulcutter and was fixed up by
@xaviershay.

JonRowe added a commit that referenced this pull request Jan 8, 2015

Merge pull request #1837 from rspec/fix-location-filtering-for-exampl…
…e-in-nested-group-in-shared-group-in-external-file

Fix location filtering for example in nested group in shared group in external file

@JonRowe JonRowe merged commit 9ebe626 into master Jan 8, 2015

2 checks passed

continuous-integration/appveyor AppVeyor build succeeded
Details
continuous-integration/travis-ci The Travis CI build passed
Details
@JonRowe

This comment has been minimized.

Copy link
Member

JonRowe commented Jan 8, 2015

Great work :)

@JonRowe JonRowe deleted the fix-location-filtering-for-example-in-nested-group-in-shared-group-in-external-file branch Jan 8, 2015

@soulcutter

This comment has been minimized.

Copy link
Member

soulcutter commented Jan 8, 2015

Really nice solution! Truly happy to see this fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.