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

Enable new rubocops #3656

Merged
merged 1 commit into from
Apr 6, 2024
Merged

Conversation

philippthun
Copy link
Member

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

@philippthun philippthun force-pushed the new-rubocops branch 2 times, most recently from 01c5d3c to 6fb961f Compare February 27, 2024 15:18
Copy link
Member

@moleske moleske left a comment

Choose a reason for hiding this comment

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

Woo! I definitely was failing at this. My mistake was apparently never adding the to be(true) off the ends of the match?

@philippthun
Copy link
Member Author

Woo! I definitely was failing at this. My mistake was apparently never adding the to be(true) off the ends of the match?

Sometimes rubocop is very persistent in forcing you into the wrong direction...

Initially the test was written as follows - which is very readable from my point of view:

expect(decorator.match?(%w[potato app turnip])).to be_truthy

Then rubocop wanted it this way (already less readable):

expect(decorator).to be_match(%w[potato app turnip])

And now the suggestion was:

expect(decorator).to match(%w[potato app turnip])

As this changed the semantics and thus failed the test, I reverted back to the original version, but with be(true) instead of be_truthy. This silenced rubocop!

@moleske moleske merged commit 7d614aa into cloudfoundry:main Apr 6, 2024
8 checks passed
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.

2 participants