Navigation Menu

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

Skip files with shared groups in RSpec/FilePath #1009

Merged
merged 1 commit into from Aug 21, 2020

Conversation

pirj
Copy link
Member

@pirj pirj commented Aug 19, 2020

https://relishapp.com/rspec/rspec-core/docs/example-groups/shared-examples states that shared groups don't have to have the _spec.rb suffix, and even preferably omit _spec.

Fixes #1008


Before submitting the PR make sure the following are checked:

  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • [-] Updated documentation.
  • Added an entry to the CHANGELOG.md if the new code introduces user-observable changes.
  • The build (bundle exec rake) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).

https://relishapp.com/rspec/rspec-core/docs/example-groups/shared-examples
states that shared groups don't have to have the _spec.rb suffix, and
even preferably omit _spec.
@pirj pirj self-assigned this Aug 19, 2020
@pirj
Copy link
Member Author

pirj commented Aug 19, 2020

@fabioxgn Please let me know if this fix resolves the issue you are experiencing.

@@ -16,7 +16,7 @@ def on_new_investigation
return unless root_node

top_level_groups.each do |node|
example_group?(node, &method(:on_top_level_example_group))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns out example_group? was yielding nil as there's no capture.

@fabioxgn
Copy link

@fabioxgn Please let me know if this fix resolves the issue you are experiencing.

It does! Thanks.

@Darhazer Darhazer merged commit 054bc95 into master Aug 21, 2020
@Darhazer Darhazer deleted the fix-file_path-cop-to-ignore-shared-groups branch August 21, 2020 20:55
bquorning pushed a commit that referenced this pull request Aug 24, 2020
…shared-groups

Skip files with shared groups in RSpec/FilePath
@bquorning bquorning mentioned this pull request Aug 25, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RSpec/FilePath false positive for a file with a shared example group
4 participants