Skip to content

Commit

Permalink
[Fix rubocop#209] Mark Minitest/AssertTruthy as unsafe autocorrection
Browse files Browse the repository at this point in the history
Fixes rubocop#209.

This PR marks `Minitest/AssertTruthy` as unsafe autocorrection.
  • Loading branch information
koic committed Dec 30, 2022
1 parent 1ed0cfa commit 3f56e4a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* [#209](https://github.com/rubocop/rubocop-minitest/issues/209): Mark `Minitest/AssertTruthy` as unsafe autocorrection. ([@koic][])
2 changes: 2 additions & 0 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ Minitest/AssertTruthy:
Description: 'This cop enforces the test to use `assert(actual)` instead of using `assert_equal(true, actual)`.'
StyleGuide: 'https://minitest.rubystyle.guide#assert-truthy'
Enabled: true
SafeAutoCorrect: false
VersionAdded: '0.2'
VersionChanged: '<<next>>'

Minitest/AssertWithExpectedArgument:
Description: 'This cop tries to detect when a user accidentally used `assert` when they meant to use `assert_equal`.'
Expand Down
3 changes: 3 additions & 0 deletions lib/rubocop/cop/minitest/assert_truthy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ module Cop
module Minitest
# Enforces the test to use `assert(actual)` instead of using `assert_equal(true, actual)`.
#
# @safety
# This cop's autocorrection is unsafe because true might be expected instead of truthy.
#
# @example
# # bad
# assert_equal(true, actual)
Expand Down

0 comments on commit 3f56e4a

Please sign in to comment.