Skip to content

Commit

Permalink
Merge pull request #145 from koic/mark_minitest_assert_empty_literal_…
Browse files Browse the repository at this point in the history
…as_safe_autocorrection

Mark `Minitest/AssertEmptyLiteral` as safe auto-correction
  • Loading branch information
koic committed Oct 3, 2021
2 parents b177996 + 50e790f commit 6ddf6f7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## master (unreleased)

### Bug fixes

* [#144](https://github.com/rubocop/rubocop-minitest/pull/144): Mark `Minitest/AssertEmptyLiteral` as safe auto-correction. ([@koic][])

## 0.15.1 (2021-09-26)

### Bug fixes
Expand Down
3 changes: 1 addition & 2 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ Minitest/AssertEmpty:
VersionAdded: '0.2'

Minitest/AssertEmptyLiteral:
Description: 'This cop enforces the test to use `assert_empty` instead of using `assert([], object)` or `assert({}, object)`.'
Description: 'This cop enforces the test to use `assert_empty` instead of using `assert_equal([], object)`.'
Enabled: true
SafeAutoCorrect: false
VersionAdded: '0.5'
VersionChanged: '0.11'

Expand Down
4 changes: 2 additions & 2 deletions docs/modules/ROOT/pages/cops_minitest.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ assert_empty(object, 'message')

| Enabled
| Yes
| Yes (Unsafe)
| Yes
| 0.5
| 0.11
|===

This cop enforces the test to use `assert_empty`
instead of using `assert_equal([], object)`.
instead of using `assert_equal([], object)` or `assert_equal({}, object)`.

=== Examples

Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/minitest/assert_empty_literal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module RuboCop
module Cop
module Minitest
# This cop enforces the test to use `assert_empty`
# instead of using `assert_equal([], object)`.
# instead of using `assert_equal([], object)` or `assert_equal({}, object)`.
#
# @example
# # bad
Expand Down

0 comments on commit 6ddf6f7

Please sign in to comment.