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

Add clearer examples for SubjectStub cop #1102

Merged
merged 1 commit into from Dec 1, 2020
Merged

Add clearer examples for SubjectStub cop #1102

merged 1 commit into from Dec 1, 2020

Conversation

cesc1989
Copy link
Contributor

@cesc1989 cesc1989 commented Dec 1, 2020

This PR updates the examples present in the SubjectStub documentation. Previous one was a good indication of when the cop would fire but didn't suggested a way to handle it.

The code examples were taken from the RSpec Style Guide. This gave me reasons to open the PR as they're already accepted ones.


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).

@pirj
Copy link
Member

pirj commented Dec 1, 2020

Thanks! I think it looks better and more aligned with https://rspec.rubystyle.guide/#dont-stub-subject

The document that you've edited is actually automatically generated from code documentation, you were looking to fix this instead and then run rake generate_cops_documentation or just rake.

While you are at it, do you think it makes sense to change the StyleGuide link of the cop to point to the community style guide?

@cesc1989
Copy link
Contributor Author

cesc1989 commented Dec 1, 2020

Thanks! I think it looks better and more aligned with https://rspec.rubystyle.guide/#dont-stub-subject

The document that you've edited is actually automatically generated from code documentation, you were looking to fix this instead and then run rake generate_cops_documentation or just rake.

While you are at it, do you think it makes sense to change the StyleGuide link of the cop to point to the community style guide?

Hi thanks!

I noticed the failed Circle CI run and realized of that! 😅 . Already working on the right file.

config/default.yml Outdated Show resolved Hide resolved
Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

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

Looks good. Yamllint has stuck.
Please squash your commits.

@cesc1989
Copy link
Contributor Author

cesc1989 commented Dec 1, 2020

Looks good. Yamllint has stuck.
Please squash your commits.

Squashed

@pirj pirj merged commit 11b1fa4 into rubocop:master Dec 1, 2020
@pirj
Copy link
Member

pirj commented Dec 1, 2020

Thanks, @cesc1989 ! 🙌

@cesc1989 cesc1989 deleted the subjectstub-examples branch December 1, 2020 22:04
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.

None yet

2 participants