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

Mark Minitest/AssertEmptyLiteral as safe auto-correction #145

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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