-
-
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
Minitest/NoAssertions does not work with minitest/spec syntax #200
Comments
Narnach
changed the title
Minitest/NoAssertions does not with minitest/spec syntax
Minitest/NoAssertions does not work with minitest/spec syntax
Nov 28, 2022
It's not explicitly stated anywhere, but as far I can tell there's never been any attempt to support |
koic
added a commit
to koic/rubocop-minitest
that referenced
this issue
Dec 3, 2022
Fixes rubocop#200. This PR supports `it` testing block for minitest/spec. `Minitest/GlobalExpectations` is already supported, so `it` testing block can also be supported by RuboCop Minitest.
8 tasks
For example, |
koic
added a commit
to koic/rubocop-minitest
that referenced
this issue
Dec 3, 2022
Fixes rubocop#200. This PR supports `it` testing block for minitest/spec. `Minitest/GlobalExpectations` is already supported, so `it` testing block can also be supported by RuboCop Minitest.
koic
added a commit
that referenced
this issue
Dec 5, 2022
[Fix #200] Support `it` testing block for minitest/spec
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
For a project I recently joined I noticed there was a test without assert.
I added
rubocop-minitest
and enabledMinitest/NoAssertions
to help detect this.To my surprise
Minitest/NoAssertions
did not detect the test as having no assertions!The root cause is that we use
minitest/spec
syntax rather than the class style. As a result we fail two internal preconditions of the current method used by NoAssertions to check if a method is a test and thus should be counted:it "does something" do .. end
style instead oftest "something" do .. end
style)I've created a failing test case similar to the ones that already exist in
test/rubocop/cop/minitest/no_assertions_test.rb
that describes the pattern of our test code. I'm unfamiliar with both Minitest and Rubocop internals so a fix appears to be harder to create.Is this something that you would like to see resolved?
The text was updated successfully, but these errors were encountered: