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 spec for RSpec/AlignLeftLetBrace and RSpec/AlignRightLetBracewith Layout/ExtraSpacing #1533

Merged
merged 1 commit into from
Dec 27, 2022

Conversation

ydah
Copy link
Member

@ydah ydah commented Dec 26, 2022

This PR is add spec for RSpec/AlignLeftLetBrace and RSpec/AlignRightLetBrace with Layout/ExtraSpacing

I found this while looking at the coverage of the test code generated by simplecov.

Before
Before

After
After


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

… with `Layout/ExtraSpacing`

This PR is add spec for `RSpec/AlignLeftLetBrace` and `RSpec/AlignRightLetBrace` with `Layout/ExtraSpacing`
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.

Fantastic!

Wondering, would it be possible to write a spec that would cover AlignRightLetBrace.autocorrect_incompatible_with? If I remove this method, this spec remains green (as opposed to it becoming red if I remove the RuboCop::Cop::Layout::ExtraSpacing.singleton_class.prepend).

Thank you!

@pirj pirj requested review from bquorning and Darhazer December 26, 2022 19:56
@ydah
Copy link
Member Author

ydah commented Dec 27, 2022

@pirj Perhaps, but I think it is because it is a method chain.
If we write this separately, it would look like this, but I don't think it's a good idea to change our code to check for code coverage, so I'm leaving it as it is.

screenshot

@pirj pirj merged commit c557186 into rubocop:master Dec 27, 2022
@pirj
Copy link
Member

pirj commented Dec 27, 2022

Thank you, @ydah !

@ydah ydah deleted the test/add_spec_for_alignLetBrace branch December 27, 2022 08:56
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.

3 participants