Skip to content
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/AssertMatch return error code #183

Closed
sylvain-msl opened this issue Sep 15, 2022 · 0 comments · Fixed by #184
Closed

Minitest/AssertMatch return error code #183

sylvain-msl opened this issue Sep 15, 2022 · 0 comments · Fixed by #184
Labels
bug Something isn't working

Comments

@sylvain-msl
Copy link

When bumping rubocop-minitest from 0.21.1 to 0.22.0 it threw:

An error occurred while Minitest/AssertMatch cop was inspecting <file_path>

whether there is or not an offense.


Expected behavior

Rubocop Minitest can run without returning an error code

Actual behavior

It return a non-zero exit code with the following output:

Scanning <file_path.rb>
An error occurred while Minitest/AssertMatch cop was inspecting <file_path.rb>:176:4.
undefined method regexp_type?' for nil:NilClass /home/me/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-minitest-0.22.0/lib/rubocop/cop/mixin/minitest_cop_rule.rb:88:in > new_arguments'
/home/me/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-minitest-0.22.0/lib/rubocop/cop/mixin/minitest_cop_rule.rb:70:in offense_message' /home/me/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-minitest-0.22.0/lib/rubocop/cop/mixin/minitest_cop_rule.rb:41:in on_send'

...

1 file inspected, no offenses detected

2 errors occurred:
An error occurred while Minitest/AssertMatch cop was inspecting <file_path.rb>:176:4.
An error occurred while Minitest/AssertMatch cop was inspecting <file_path.rb>:176:4.

Errors are usually caused by RuboCop bugs.
Please, report your problems to RuboCop's issue tracker.
Mention the following information in the issue report:
1.36.0 (using Parser 3.1.2.1, rubocop-ast 1.21.0, running on ruby 3.1.2) [x86_64-linux]

Steps to reproduce the problem

in a test add

assert <something>.exact_match
assert <something>.match

run bundle exec rubocop --autocorrect-all <file_path.rb>

RuboCop version

╰─ bundle exec rubocop -V                                                                                                                                                                                                      
1.36.0 (using Parser 3.1.2.1, rubocop-ast 1.21.0, running on ruby 3.1.2) [x86_64-linux]
  - rubocop-doctolib 0.1.0
  - rubocop-minitest 0.22.0
  - rubocop-performance 1.15.0
  - rubocop-rails 2.15.2
  - rubocop-rake 0.6.0
@koic koic added the bug Something isn't working label Sep 15, 2022
koic added a commit to koic/rubocop-minitest that referenced this issue Sep 15, 2022
Fixes rubocop#183.

This PR fixes an error for `Minitest/AssertMatch` when using `assert` with no arguments `match`.
koic added a commit to koic/rubocop-minitest that referenced this issue Sep 16, 2022
Fixes rubocop#183.

This PR fixes an error for `Minitest/AssertMatch` when using `assert` with no arguments `match`.
@koic koic closed this as completed in #184 Sep 17, 2022
koic added a commit that referenced this issue Sep 17, 2022
[Fix #183] Fix an error for `Minitest/AssertMatch`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants