You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This strange syntax is used to intentionally pass a block without any side effects to the method, because this particular test is focused on advancing the Reader's cursor and ensuring parse errors are handled.
After the fix in 7d612d7 the following exception is raised:
rubocop -d /home/flavorjones/code/oss/nokogiri/test/xml/test_reader.rb
For /home/flavorjones/code/oss/nokogiri: configuration from /home/flavorjones/code/oss/nokogiri/.rubocop.yml
configuration from /home/flavorjones/code/oss/rubocop-minitest/config/default.yml
configuration from /home/flavorjones/code/oss/rubocop-minitest/config/default.yml
Default configuration from /home/flavorjones/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.37.1/config/default.yml
configuration from /home/flavorjones/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-performance-1.15.0/config/default.yml
configuration from /home/flavorjones/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-performance-1.15.0/config/default.yml
configuration from /home/flavorjones/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-rake-0.6.0/config/default.yml
configuration from /home/flavorjones/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-rake-0.6.0/config/default.yml
Inheriting configuration from /home/flavorjones/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-shopify-2.9.0/rubocop.yml
Inheriting configuration from /home/flavorjones/code/oss/nokogiri/.rubocop_todo.yml
Use parallel by default.
Skipping parallel inspection: only a single file needs inspection
Inspecting 1 file
Scanning /home/flavorjones/code/oss/nokogiri/test/xml/test_reader.rb
An error occurred while Minitest/EmptyLineBeforeAssertionMethods cop was inspecting /home/flavorjones/code/oss/nokogiri/test/xml/test_reader.rb:206:10.
undefined method `send_type?' for nil:NilClass
return false unless node.send_type?
^^^^^^^^^^^
/home/flavorjones/code/oss/rubocop-minitest/lib/rubocop/cop/mixin/minitest_exploration_helpers.rb:81:in `assertion_method?'
/home/flavorjones/code/oss/rubocop-minitest/lib/rubocop/cop/minitest/empty_line_before_assertion_methods.rb:42:in `assertion_method'
/home/flavorjones/code/oss/rubocop-minitest/lib/rubocop/cop/minitest/empty_line_before_assertion_methods.rb:26:in `on_send'
/home/flavorjones/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.37.1/lib/rubocop/cop/commissioner.rb:100:in `public_send'
/home/flavorjones/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.37.1/lib/rubocop/cop/commissioner.rb:100:in `block (2 levels) in trigger_responding_cops'
...
.
1 file inspected, no offenses detected
1 error occurred:
An error occurred while Minitest/EmptyLineBeforeAssertionMethods cop was inspecting /home/flavorjones/code/oss/nokogiri/test/xml/test_reader.rb:206:10.
Errors are usually caused by RuboCop bugs.
Please, report your problems to RuboCop's issue tracker.
https://github.com/rubocop/rubocop/issues
Mention the following information in the issue report:
1.37.1 (using Parser 3.1.2.1, rubocop-ast 1.23.0, running on ruby 3.1.2) [x86_64-linux]
Finished in 0.6805142869998235 seconds
There is at least one other place in the Nokogiri suite where we pass an empty block, so I imagine other projects may be (rarely) doing something similar.
…ssertionMethods`
Fixesrubocop#189 and rubocop#194.
This PR fixes a false negative for `Minitest/EmptyLineBeforeAssertionMethods`
when using assertion method used in block before assertion method.
After 7d612d7 an error is raised when a set has an empty block.
Steps to reproduce the problem
The following test exists in the Nokogiri code base:
The key line is
This strange syntax is used to intentionally pass a block without any side effects to the method, because this particular test is focused on advancing the Reader's cursor and ensuring parse errors are handled.
After the fix in 7d612d7 the following exception is raised:
There is at least one other place in the Nokogiri suite where we pass an empty block, so I imagine other projects may be (rarely) doing something similar.
RuboCop version
(note that the rubocop-minitest version is incorrect, I've run the above using e3b4936)
The text was updated successfully, but these errors were encountered: