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

Autocorrection of heredocs is an error #42

Closed
dduugg opened this issue Dec 9, 2019 · 0 comments · Fixed by #44
Closed

Autocorrection of heredocs is an error #42

dduugg opened this issue Dec 9, 2019 · 0 comments · Fixed by #44
Labels
bug Something isn't working

Comments

@dduugg
Copy link

dduugg commented Dec 9, 2019

This is observed for both Minitest/AssertEmpty and Minitest/AssertIncludes.
For example:

-      assert(task.result.include?(line), <<~EOF
-        Expected to find "#{line}" but couldn't.
-        Actual output was:
-          #{task.result.join("\n  ")}
-      EOF
-      )
+      assert_includes(task.result, line, <<~EOF)

I'm using rubocop 0.74.0 and rubocop-minitest 0.5.0

@koic koic added the bug Something isn't working label Dec 10, 2019
koic added a commit to koic/rubocop-minitest that referenced this issue Dec 20, 2019
…est`

Fixes rubocop#42.

This PR fixes an incorrect autocorrect for the following cops
when using heredoc message.

* `Minitest/AssertIncludes`
* `Minitest/RefuteIncludes`
* `Minitest/AssertEmpty`
* `Minitest/RefuteEmpty`
* `Minitest/AssertEqual`
* `Minitest/RefuteEqual`
* `Minitest/AssertInstanceOf`
* `Minitest/RefuteInstanceOf`
* `Minitest/AssertRespondTo`
* `Minitest/RefuteRespondTo`
* `Minitest/AssertNil`
* `Minitest/RefuteNil`
* `Minitest/AssertTruthy`
* `Minitest/RefuteFalse`
koic added a commit to koic/rubocop-minitest that referenced this issue Dec 20, 2019
…est`

Fixes rubocop#42.

This PR fixes an incorrect autocorrect for the following cops
when using heredoc message.

* `Minitest/AssertIncludes`
* `Minitest/RefuteIncludes`
* `Minitest/AssertEmpty`
* `Minitest/RefuteEmpty`
* `Minitest/AssertEqual`
* `Minitest/RefuteEqual`
* `Minitest/AssertInstanceOf`
* `Minitest/RefuteInstanceOf`
* `Minitest/AssertRespondTo`
* `Minitest/RefuteRespondTo`
* `Minitest/AssertNil`
* `Minitest/RefuteNil`
* `Minitest/AssertTruthy`
* `Minitest/RefuteFalse`
koic added a commit to koic/rubocop-minitest that referenced this issue Dec 20, 2019
…est`

Fixes rubocop#42.

This PR fixes an incorrect autocorrect for the following cops
when using heredoc message.

* `Minitest/AssertIncludes`
* `Minitest/RefuteIncludes`
* `Minitest/AssertEmpty`
* `Minitest/RefuteEmpty`
* `Minitest/AssertEqual`
* `Minitest/RefuteEqual`
* `Minitest/AssertInstanceOf`
* `Minitest/RefuteInstanceOf`
* `Minitest/AssertRespondTo`
* `Minitest/RefuteRespondTo`
* `Minitest/AssertNil`
* `Minitest/RefuteNil`
* `Minitest/AssertTruthy`
* `Minitest/RefuteFalse`
@koic koic closed this as completed in #44 Dec 23, 2019
koic added a commit that referenced this issue Dec 23, 2019
…me_cops

[Fix #42] Fix an incorrect autocorrect for some cops of `Minitest`
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