-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Loop between Minitest/AssertTruthy and Minitest/AssertWithExpectedArgument when passing msg
option to assert
#206
Comments
msg
optionmsg
option to assert
So I think, the best solution is to just disable this cop for that line. |
koic
added a commit
to koic/rubocop-minitest
that referenced
this issue
Dec 23, 2022
… message variable Fixes rubocop#206. This PR makes `Minitest/AssertWithExpectedArgument` aware of message variable. The second argument to the `assert` method named `message` and `msg` is allowed. Because their names are inferred as message arguments.
8 tasks
I've opened #206. The second argument to the |
koic
added a commit
that referenced
this issue
Dec 23, 2022
…argument_aware_of_message_variable [Fix #206] Make `Minitest/AssertWithExpectedArgument` aware of message variable
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
desc
I think there is an issue when passing the optional argument
msg
that is allowed for allassert*
methods. When using that optional argument i think the gem gets confused and thinks you want to test equality between the first argument (the test) and the second optional argument (msg). i've added more context to the expected behavior section with code examples.ref: https://docs.ruby-lang.org/en/2.1.0/MiniTest/Assertions.html
Expected behavior
I expect
Minitest/AssertWithExpectedArgument
not to be raised when passing optional msg argument toassert
Actual behavior
When passing
msg
rubocop complains about usingassert_equal(test, msg)
Steps to reproduce the problem
given:
when:
$ rubocop
then:
given:
when:
$ rubocop -a
then:
and we are back to the first example...
RuboCop version
The text was updated successfully, but these errors were encountered: