-
Notifications
You must be signed in to change notification settings - Fork 293
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 some Minitest/ cops #11065
Fix some Minitest/ cops #11065
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the underscore is confusing gettext for katello/spec/models/host_collection_spec.rb
. Perhaps because the underscore is also used to mark translations? The cop guide seems to have some examples without underscores.
2d856dc
to
095124f
Compare
I have followed different style for that specific file you mentioned, but not sure if this is good to follow different style for different files. wdyt? |
It might be best to avoid the underscores entirely if possible since that usually represents translations. I don't feel super strongly about it though since it's in tests only as far as I see. |
6da69f6
to
c20e4e2
Compare
Done! @ianballou |
Looks like there are two failures left, I'm seeing |
c20e4e2
to
d0d422e
Compare
@ianballou not sure what this failure now, can you help me in this? |
spec/models/host_collection_spec.rb
Outdated
end | ||
|
||
it "should not allow unlimited_hosts=false and max_hosts to be nil at the same time" do | ||
create = lambda do | ||
HostCollection.create!(:name => "TestHostCollection", :organization => @org, :unlimited_hosts => false) | ||
end | ||
create.must_raise(ActiveRecord::RecordInvalid) | ||
value { create }.must_raise(ActiveRecord::RecordInvalid) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the issue:
value { create }.must_raise(ActiveRecord::RecordInvalid) | |
value(create).must_raise(ActiveRecord::RecordInvalid) |
d0d422e
to
ad99939
Compare
The latest test failures are pretty odd -- need to see what's going on there. Maybe in the meantime rebase if you haven't. |
Please rebase once #11076 is merged. |
ad99939
to
7cc89c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks @archanaserver !
Thanks for the review @ianballou! |
What are the changes introduced in this pull request?
Based on: #11009
This pull request addresses the Minitest/GlobalExpectations RuboCop offense by replacing global expectation methods with the recommended non-global expectation methods.
https://docs.rubocop.org/rubocop-minitest/cops_minitest.html#minitestglobalexpectations
Considerations taken when implementing this change?
Verified that the changes do not impact existing functionality or cause syntax errors.
What are the testing steps for this pull request?
bundle exec rubocop