Closed broksonic21 closed 11 months ago
You can pass the --debug
option. But it would be best if you can provide a minimal example of the code it's being run against.
Looks like it's here: https://github.com/rubocop/rubocop-minitest/blob/master/lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#L104
An error occurred while Minitest/MultipleAssertions cop was inspecting /Users/REDACTED/REDACTED:7:4.
undefined method `assignment?' for nil:NilClass
/Users/REDACTED/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/mixin/minitest_exploration_helpers.rb:104:in `assertion_method?'
/Users/REDACTED/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/mixin/minitest_exploration_helpers.rb:104:in `assertion_method?'
/Users/REDACTED/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:68:in `assertions_count'
/Users/REDACTED/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:65:in `block in assertions_count'
/Users/REDACTED/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/rubocop-ast-1.30.0/lib/rubocop/ast/node/mixin/descendence.rb:28:in `block in each_child_node'
/Users/REDACTED/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/rubocop-ast-1.30.0/lib/rubocop/ast/node/mixin/descendence.rb:25:in `each'
/Users/REDACTED/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/rubocop-ast-1.30.0/lib/rubocop/ast/node/mixin/descendence.rb:25:in `each_child_node'
/Users/REDACTED/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:65:in `each'
/Users/REDACTED/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:65:in `sum'
/Users/REDACTED/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:65:in `assertions_count'
/Users/REDACTED/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:65:in `block in assertions_count'
/Users/REDACTED/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/rubocop-ast-1.30.0/lib/rubocop/ast/node/mixin/descendence.rb:28:in `block in each_child_node'
/Users/REDACTED/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/rubocop-ast-1.30.0/lib/rubocop/ast/node/mixin/descendence.rb:25:in `each'
/Users/REDACTED/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/rubocop-ast-1.30.0/lib/rubocop/ast/node/mixin/descendence.rb:25:in `each_child_node'
/Users/REDACTED/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:65:in `each'
/Users/REDACTED/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:65:in `sum'
/Users/REDACTED/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:65:in `assertions_count'
/Users/REDACTED/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/rubocop-minitest-0.34.1/lib/rubocop/cop/minitest/multiple_assertions.rb:65:in `block in assertions_count'
/Users/REDACTED/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/rubocop-ast-1.30.0/lib/rubocop/ast/node/mixin/descendence.rb:28:in `block in each_child_node'
/Users/REDACTED/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/rubocop-ast-1.30.0/lib/rubocop/ast/node/mixin/descendence.rb:25:in `each'
# frozen_string_literal: true
class FooTest < ::Test
def test_it_fails
_, b = try_update(foo: 3) do
see(bar: c.bar, baz: "baz")
end
assert_eq c.id, b.id
assert_eq c.foo, b.foo
end
end
reproes this.
nothing to do with asserts, it looks like:
# frozen_string_literal: true
class FooTest < ::Test
def test_it_fails
_d, _b = try_update(foo: 3) do
see(bar: c.bar, baz: "baz")
end
end
end
has same error - must be anytime there's a split return value?
This issue is a dup with #283. Thank you for your feedback.
Expected behavior
Bumping to 0.34.1 shouldn't return errors, but getting throughout our code base
Actual behavior
Steps to reproduce the problem
dont' have a private repo yet, but seeing this through out code base. Is there a way to get even deeper verbose logs?
RuboCop version