rubocop-minitest 0.10.2 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +3 -3
- data/.github/ISSUE_TEMPLATE/bug_report.md +5 -1
- data/.rubocop.yml +4 -1
- data/CHANGELOG.md +96 -51
- data/CONTRIBUTING.md +3 -3
- data/Gemfile +2 -2
- data/LICENSE.txt +1 -1
- data/README.md +4 -4
- data/Rakefile +1 -1
- data/bin/console +2 -0
- data/config/default.yml +15 -4
- data/docs/antora.yml +1 -1
- data/docs/modules/ROOT/pages/cops.adoc +2 -0
- data/docs/modules/ROOT/pages/cops_minitest.adoc +78 -7
- data/docs/modules/ROOT/pages/index.adoc +1 -1
- data/legacy-docs/cops_minitest.md +16 -16
- data/legacy-docs/index.md +1 -1
- data/lib/rubocop/cop/minitest/assert_empty.rb +1 -1
- data/lib/rubocop/cop/minitest/assert_empty_literal.rb +12 -16
- data/lib/rubocop/cop/minitest/assert_equal.rb +1 -1
- data/lib/rubocop/cop/minitest/assert_in_delta.rb +4 -1
- data/lib/rubocop/cop/minitest/assert_includes.rb +1 -1
- data/lib/rubocop/cop/minitest/assert_instance_of.rb +1 -1
- data/lib/rubocop/cop/minitest/assert_kind_of.rb +1 -1
- data/lib/rubocop/cop/minitest/assert_match.rb +1 -1
- data/lib/rubocop/cop/minitest/assert_nil.rb +5 -11
- data/lib/rubocop/cop/minitest/assert_output.rb +1 -1
- data/lib/rubocop/cop/minitest/assert_path_exists.rb +6 -12
- data/lib/rubocop/cop/minitest/assert_respond_to.rb +1 -1
- data/lib/rubocop/cop/minitest/assert_silent.rb +8 -6
- data/lib/rubocop/cop/minitest/assert_truthy.rb +5 -11
- data/lib/rubocop/cop/minitest/assert_with_expected_argument.rb +41 -0
- data/lib/rubocop/cop/minitest/assertion_in_lifecycle_hook.rb +1 -1
- data/lib/rubocop/cop/minitest/global_expectations.rb +6 -7
- data/lib/rubocop/cop/minitest/literal_as_actual_argument.rb +15 -14
- data/lib/rubocop/cop/minitest/multiple_assertions.rb +2 -2
- data/lib/rubocop/cop/minitest/no_assertions.rb +48 -0
- data/lib/rubocop/cop/minitest/refute_empty.rb +1 -1
- data/lib/rubocop/cop/minitest/refute_equal.rb +6 -7
- data/lib/rubocop/cop/minitest/refute_false.rb +15 -22
- data/lib/rubocop/cop/minitest/refute_in_delta.rb +4 -1
- data/lib/rubocop/cop/minitest/refute_includes.rb +1 -1
- data/lib/rubocop/cop/minitest/refute_instance_of.rb +1 -1
- data/lib/rubocop/cop/minitest/refute_kind_of.rb +1 -1
- data/lib/rubocop/cop/minitest/refute_match.rb +1 -1
- data/lib/rubocop/cop/minitest/refute_nil.rb +4 -8
- data/lib/rubocop/cop/minitest/refute_path_exists.rb +6 -12
- data/lib/rubocop/cop/minitest/refute_respond_to.rb +1 -1
- data/lib/rubocop/cop/minitest/test_method_name.rb +18 -8
- data/lib/rubocop/cop/minitest/unspecified_exception.rb +1 -1
- data/lib/rubocop/cop/minitest_cops.rb +2 -0
- data/lib/rubocop/cop/mixin/in_delta_mixin.rb +5 -15
- data/lib/rubocop/cop/mixin/minitest_cop_rule.rb +12 -12
- data/lib/rubocop/cop/mixin/minitest_exploration_helpers.rb +20 -3
- data/lib/rubocop/minitest/version.rb +1 -1
- data/mkdocs.yml +2 -2
- data/relnotes/v0.1.0.md +1 -1
- data/relnotes/v0.10.0.md +12 -12
- data/relnotes/v0.10.1.md +1 -1
- data/relnotes/v0.10.2.md +1 -1
- data/relnotes/v0.10.3.md +5 -0
- data/relnotes/v0.11.0.md +16 -0
- data/relnotes/v0.11.1.md +5 -0
- data/relnotes/v0.12.0.md +10 -0
- data/relnotes/v0.12.1.md +5 -0
- data/relnotes/v0.2.0.md +4 -4
- data/relnotes/v0.2.1.md +1 -1
- data/relnotes/v0.3.0.md +6 -6
- data/relnotes/v0.4.0.md +5 -5
- data/relnotes/v0.4.1.md +1 -1
- data/relnotes/v0.5.0.md +1 -1
- data/relnotes/v0.5.1.md +1 -1
- data/relnotes/v0.6.0.md +1 -1
- data/relnotes/v0.6.1.md +2 -2
- data/relnotes/v0.6.2.md +1 -1
- data/relnotes/v0.7.0.md +5 -5
- data/relnotes/v0.8.0.md +4 -4
- data/relnotes/v0.8.1.md +1 -1
- data/relnotes/v0.9.0.md +3 -3
- data/rubocop-minitest.gemspec +5 -5
- data/tasks/cops_documentation.rake +9 -11
- metadata +17 -10
@@ -15,7 +15,7 @@ module RuboCop
|
|
15
15
|
# refute_includes(collection, object)
|
16
16
|
# refute_includes(collection, object, 'message')
|
17
17
|
#
|
18
|
-
class RefuteIncludes <
|
18
|
+
class RefuteIncludes < Base
|
19
19
|
extend MinitestCopRule
|
20
20
|
|
21
21
|
define_rule :refute, target_method: :include?, preferred_method: :refute_includes
|
@@ -15,7 +15,7 @@ module RuboCop
|
|
15
15
|
# refute_instance_of(Class, object)
|
16
16
|
# refute_instance_of(Class, object, 'message')
|
17
17
|
#
|
18
|
-
class RefuteInstanceOf <
|
18
|
+
class RefuteInstanceOf < Base
|
19
19
|
extend MinitestCopRule
|
20
20
|
|
21
21
|
define_rule :refute, target_method: :instance_of?, inverse: true
|
@@ -15,11 +15,13 @@ module RuboCop
|
|
15
15
|
# refute_nil(actual)
|
16
16
|
# refute_nil(actual, 'message')
|
17
17
|
#
|
18
|
-
class RefuteNil <
|
18
|
+
class RefuteNil < Base
|
19
19
|
include ArgumentRangeHelper
|
20
|
+
extend AutoCorrector
|
20
21
|
|
21
22
|
MSG = 'Prefer using `refute_nil(%<arguments>s)` over ' \
|
22
23
|
'`refute_equal(nil, %<arguments>s)`.'
|
24
|
+
RESTRICT_ON_SEND = %i[refute_equal].freeze
|
23
25
|
|
24
26
|
def_node_matcher :refute_equal_with_nil, <<~PATTERN
|
25
27
|
(send nil? :refute_equal nil $_ $...)
|
@@ -31,13 +33,7 @@ module RuboCop
|
|
31
33
|
|
32
34
|
arguments = [actual.source, message&.source].compact.join(', ')
|
33
35
|
|
34
|
-
add_offense(node, message: format(MSG, arguments: arguments))
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
def autocorrect(node)
|
39
|
-
lambda do |corrector|
|
40
|
-
refute_equal_with_nil(node) do |actual|
|
36
|
+
add_offense(node, message: format(MSG, arguments: arguments)) do |corrector|
|
41
37
|
corrector.replace(node.loc.selector, 'refute_nil')
|
42
38
|
corrector.replace(
|
43
39
|
first_and_second_arguments_range(node), actual.source
|
@@ -15,8 +15,11 @@ module RuboCop
|
|
15
15
|
# refute_path_exists(path)
|
16
16
|
# refute_path_exists(path, 'message')
|
17
17
|
#
|
18
|
-
class RefutePathExists <
|
18
|
+
class RefutePathExists < Base
|
19
|
+
extend AutoCorrector
|
20
|
+
|
19
21
|
MSG = 'Prefer using `%<good_method>s` over `%<bad_method>s`.'
|
22
|
+
RESTRICT_ON_SEND = %i[refute].freeze
|
20
23
|
|
21
24
|
def_node_matcher :refute_file_exists, <<~PATTERN
|
22
25
|
(send nil? :refute
|
@@ -31,17 +34,8 @@ module RuboCop
|
|
31
34
|
good_method = build_good_method(path, failure_message)
|
32
35
|
message = format(MSG, good_method: good_method, bad_method: node.source)
|
33
36
|
|
34
|
-
add_offense(node, message: message)
|
35
|
-
|
36
|
-
end
|
37
|
-
|
38
|
-
def autocorrect(node)
|
39
|
-
refute_file_exists(node) do |path, failure_message|
|
40
|
-
failure_message = failure_message.first
|
41
|
-
|
42
|
-
lambda do |corrector|
|
43
|
-
replacement = build_good_method(path, failure_message)
|
44
|
-
corrector.replace(node, replacement)
|
37
|
+
add_offense(node, message: message) do |corrector|
|
38
|
+
corrector.replace(node, good_method)
|
45
39
|
end
|
46
40
|
end
|
47
41
|
end
|
@@ -17,7 +17,7 @@ module RuboCop
|
|
17
17
|
# refute_respond_to(object, :do_something, 'message')
|
18
18
|
# refute_respond_to(self, :do_something)
|
19
19
|
#
|
20
|
-
class RefuteRespondTo <
|
20
|
+
class RefuteRespondTo < Base
|
21
21
|
extend MinitestCopRule
|
22
22
|
|
23
23
|
define_rule :refute, target_method: :respond_to?
|
@@ -4,6 +4,7 @@ module RuboCop
|
|
4
4
|
module Cop
|
5
5
|
module Minitest
|
6
6
|
# This cop enforces that test method names start with `test_` prefix.
|
7
|
+
# It aims to prevent tests that aren't executed by forgetting to start test method name with `test_`.
|
7
8
|
#
|
8
9
|
# @example
|
9
10
|
# # bad
|
@@ -20,9 +21,16 @@ module RuboCop
|
|
20
21
|
# end
|
21
22
|
# end
|
22
23
|
#
|
23
|
-
|
24
|
+
# # good
|
25
|
+
# class FooTest < Minitest::Test
|
26
|
+
# def helper_method(argument)
|
27
|
+
# end
|
28
|
+
# end
|
29
|
+
#
|
30
|
+
class TestMethodName < Base
|
24
31
|
include MinitestExplorationHelpers
|
25
32
|
include DefNode
|
33
|
+
extend AutoCorrector
|
26
34
|
|
27
35
|
MSG = 'Test method name should start with `test_` prefix.'
|
28
36
|
|
@@ -30,13 +38,13 @@ module RuboCop
|
|
30
38
|
return unless test_class?(class_node)
|
31
39
|
|
32
40
|
class_elements(class_node).each do |node|
|
33
|
-
|
34
|
-
end
|
35
|
-
end
|
41
|
+
next unless offense?(node)
|
36
42
|
|
37
|
-
|
38
|
-
|
39
|
-
|
43
|
+
test_method_name = node.loc.name
|
44
|
+
|
45
|
+
add_offense(test_method_name) do |corrector|
|
46
|
+
corrector.replace(test_method_name, "test_#{node.method_name}")
|
47
|
+
end
|
40
48
|
end
|
41
49
|
end
|
42
50
|
|
@@ -54,7 +62,9 @@ module RuboCop
|
|
54
62
|
end
|
55
63
|
|
56
64
|
def offense?(node)
|
57
|
-
|
65
|
+
return false if assertions(node).none?
|
66
|
+
|
67
|
+
public?(node) && node.arguments.empty? && !test_method_name?(node) && !lifecycle_hook_method?(node)
|
58
68
|
end
|
59
69
|
|
60
70
|
def public?(node)
|
@@ -14,7 +14,7 @@ module RuboCop
|
|
14
14
|
# assert_raises(FooException) { raise FooException }
|
15
15
|
# assert_raises(FooException, 'This should have raised') { raise FooException }
|
16
16
|
#
|
17
|
-
class UnspecifiedException <
|
17
|
+
class UnspecifiedException < Base
|
18
18
|
MSG = 'Specify the exception being captured.'
|
19
19
|
|
20
20
|
def on_block(block_node)
|
@@ -8,6 +8,7 @@ require_relative 'minitest/assert_empty'
|
|
8
8
|
require_relative 'minitest/assert_empty_literal'
|
9
9
|
require_relative 'minitest/assert_equal'
|
10
10
|
require_relative 'minitest/assert_in_delta'
|
11
|
+
require_relative 'minitest/assert_with_expected_argument'
|
11
12
|
require_relative 'minitest/assertion_in_lifecycle_hook'
|
12
13
|
require_relative 'minitest/assert_kind_of'
|
13
14
|
require_relative 'minitest/assert_nil'
|
@@ -22,6 +23,7 @@ require_relative 'minitest/assert_truthy'
|
|
22
23
|
require_relative 'minitest/global_expectations'
|
23
24
|
require_relative 'minitest/literal_as_actual_argument'
|
24
25
|
require_relative 'minitest/multiple_assertions'
|
26
|
+
require_relative 'minitest/no_assertions'
|
25
27
|
require_relative 'minitest/refute_empty'
|
26
28
|
require_relative 'minitest/refute_false'
|
27
29
|
require_relative 'minitest/refute_equal'
|
@@ -9,24 +9,14 @@ module RuboCop
|
|
9
9
|
def on_send(node)
|
10
10
|
equal_floats_call(node) do |expected, actual, message|
|
11
11
|
message = message.first
|
12
|
+
good_method = build_good_method(expected, actual, message)
|
12
13
|
|
13
14
|
if expected.float_type? || actual.float_type?
|
14
|
-
message = format(MSG,
|
15
|
-
good_method: build_good_method(expected, actual, message),
|
16
|
-
bad_method: node.source)
|
15
|
+
message = format(MSG, good_method: good_method, bad_method: node.source)
|
17
16
|
|
18
|
-
add_offense(node, message: message)
|
19
|
-
|
20
|
-
|
21
|
-
end
|
22
|
-
|
23
|
-
def autocorrect(node)
|
24
|
-
equal_floats_call(node) do |expected, actual, message|
|
25
|
-
message = message.first
|
26
|
-
replacement = build_good_method(expected, actual, message)
|
27
|
-
|
28
|
-
lambda do |corrector|
|
29
|
-
corrector.replace(node, replacement)
|
17
|
+
add_offense(node, message: message) do |corrector|
|
18
|
+
corrector.replace(node, good_method)
|
19
|
+
end
|
30
20
|
end
|
31
21
|
end
|
32
22
|
end
|
@@ -26,32 +26,32 @@ module RuboCop
|
|
26
26
|
|
27
27
|
class_eval(<<~RUBY, __FILE__, __LINE__ + 1)
|
28
28
|
include ArgumentRangeHelper
|
29
|
+
extend AutoCorrector
|
29
30
|
|
30
31
|
MSG = 'Prefer using `#{preferred_method}(%<new_arguments>s)` over ' \
|
31
32
|
'`#{assertion_method}(%<original_arguments>s)`.'
|
33
|
+
RESTRICT_ON_SEND = %i[#{assertion_method}].freeze
|
32
34
|
|
33
35
|
def on_send(node)
|
34
36
|
return unless node.method?(:#{assertion_method})
|
35
37
|
return unless (arguments = peel_redundant_parentheses_from(node.arguments))
|
36
38
|
return unless arguments.first.respond_to?(:method?) && arguments.first.method?(:#{target_method})
|
37
39
|
|
38
|
-
add_offense(node, message: offense_message(arguments))
|
40
|
+
add_offense(node, message: offense_message(arguments)) do |corrector|
|
41
|
+
autocorrect(corrector, node, arguments)
|
42
|
+
end
|
39
43
|
end
|
40
44
|
|
41
|
-
def autocorrect(node)
|
42
|
-
|
43
|
-
corrector.replace(node.loc.selector, '#{preferred_method}')
|
44
|
-
|
45
|
-
arguments = peel_redundant_parentheses_from(node.arguments)
|
45
|
+
def autocorrect(corrector, node, arguments)
|
46
|
+
corrector.replace(node.loc.selector, '#{preferred_method}')
|
46
47
|
|
47
|
-
|
48
|
+
new_arguments = new_arguments(arguments).join(', ')
|
48
49
|
|
49
|
-
|
50
|
-
|
51
|
-
end
|
52
|
-
|
53
|
-
corrector.replace(first_argument_range(node), new_arguments)
|
50
|
+
if enclosed_in_redundant_parentheses?(node)
|
51
|
+
new_arguments = '(' + new_arguments + ')'
|
54
52
|
end
|
53
|
+
|
54
|
+
corrector.replace(first_argument_range(node), new_arguments)
|
55
55
|
end
|
56
56
|
|
57
57
|
private
|
@@ -10,6 +10,17 @@ module RuboCop
|
|
10
10
|
|
11
11
|
ASSERTION_PREFIXES = %w[assert refute].freeze
|
12
12
|
|
13
|
+
ASSERTION_METHODS = %i[
|
14
|
+
assert assert_empty assert_equal assert_in_delta assert_in_epsilon assert_includes assert_instance_of
|
15
|
+
assert_kind_of assert_match assert_nil assert_operator assert_output assert_path_exists assert_predicate
|
16
|
+
assert_raises assert_respond_to assert_same assert_send assert_silent assert_throws
|
17
|
+
refute refute_empty refute_equal refute_in_delta refute_in_epsilon refute_includes refute_instance_of
|
18
|
+
refute_kind_of refute_match refute_nil refute_operator refute_path_exists refute_predicate
|
19
|
+
refute_respond_to refute_same
|
20
|
+
].freeze
|
21
|
+
|
22
|
+
FLUNK = 'flunk'
|
23
|
+
|
13
24
|
LIFECYCLE_HOOK_METHODS = %i[
|
14
25
|
before_setup
|
15
26
|
setup
|
@@ -33,8 +44,7 @@ module RuboCop
|
|
33
44
|
end
|
34
45
|
|
35
46
|
def test_cases(class_node)
|
36
|
-
class_def_nodes(class_node)
|
37
|
-
.select { |def_node| test_case_name?(def_node.method_name) }
|
47
|
+
class_def_nodes(class_node).select { |def_node| test_case_name?(def_node.method_name) }
|
38
48
|
end
|
39
49
|
|
40
50
|
def lifecycle_hooks(class_node)
|
@@ -73,7 +83,14 @@ module RuboCop
|
|
73
83
|
|
74
84
|
def assertion?(node)
|
75
85
|
node.send_type? &&
|
76
|
-
ASSERTION_PREFIXES.any?
|
86
|
+
ASSERTION_PREFIXES.any? do |prefix|
|
87
|
+
method_name = node.method_name.to_s
|
88
|
+
method_name == FLUNK || method_name.start_with?(prefix)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
def assertion_method?(method_name)
|
93
|
+
method_name == FLUNK || ASSERTION_METHODS.include?(method_name)
|
77
94
|
end
|
78
95
|
|
79
96
|
def lifecycle_hook_method?(node)
|
data/mkdocs.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
site_name: "A RuboCop extension focused on enforcing Minitest best practices and coding conventions."
|
2
|
-
repo_url: https://github.com/rubocop
|
2
|
+
repo_url: https://github.com/rubocop/rubocop-minitest
|
3
3
|
edit_uri: edit/master/legacy-docs/
|
4
|
-
copyright: "Copyright ©
|
4
|
+
copyright: "Copyright © 2021 Bozhidar Batsov, Jonas Arvidsson, Koichi ITO, and RuboCop contributors"
|
5
5
|
docs_dir: legacy-docs
|
6
6
|
pages:
|
7
7
|
- Home: index.md
|
data/relnotes/v0.1.0.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
### New features
|
2
2
|
|
3
3
|
* Create RuboCop Minitest gem. ([@koic][])
|
4
|
-
* [#6](https://github.com/rubocop
|
4
|
+
* [#6](https://github.com/rubocop/rubocop-minitest/pull/6): Add new `Minitest/AssertNil` cop. ([@duduribeiro ][])
|
5
5
|
|
6
6
|
[@koic]: https://github.com/koic
|
7
7
|
[@duduribeiro]: https://github.com/duduribeiro
|
data/relnotes/v0.10.0.md
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
### New features
|
2
2
|
|
3
|
-
* [#92](https://github.com/rubocop
|
4
|
-
* [#95](https://github.com/rubocop
|
5
|
-
* [#91](https://github.com/rubocop
|
6
|
-
* [#89](https://github.com/rubocop
|
7
|
-
* [#83](https://github.com/rubocop
|
8
|
-
* [#88](https://github.com/rubocop
|
9
|
-
* [#87](https://github.com/rubocop
|
10
|
-
* [#96](https://github.com/rubocop
|
11
|
-
* [#98](https://github.com/rubocop
|
12
|
-
* [#84](https://github.com/rubocop
|
13
|
-
* [#85](https://github.com/rubocop
|
3
|
+
* [#92](https://github.com/rubocop/rubocop-minitest/pull/92): Add new `Minitest/LiteralAsActualArgument` cop. ([@fatkodima][], [@tsmmark][])
|
4
|
+
* [#95](https://github.com/rubocop/rubocop-minitest/pull/95): Add new `Minitest/AssertionInLifecycleHook` cop. ([@fatkodima][])
|
5
|
+
* [#91](https://github.com/rubocop/rubocop-minitest/pull/91): Add new `Minitest/AssertInDelta` and `Minitest/RefuteInDelta` cops. ([@fatkodima][])
|
6
|
+
* [#89](https://github.com/rubocop/rubocop-minitest/pull/89): Add new `Minitest/TestMethodName` cop. ([@fatkodima][])
|
7
|
+
* [#83](https://github.com/rubocop/rubocop-minitest/pull/83): New cops `AssertPathExists` and `RefutePathExists` check for use of `assert_path_exists`/`refute_path_exists` instead of `assert(File.exist?(path))`/`refute(File.exist?(path))`. ([@fatkodima][])
|
8
|
+
* [#88](https://github.com/rubocop/rubocop-minitest/pull/88): Add new `Minitest/MultipleAssertions` cop. ([@fatkodima][])
|
9
|
+
* [#87](https://github.com/rubocop/rubocop-minitest/pull/87): Add new `Minitest/AssertSilent` cop. ([@fatkodima][])
|
10
|
+
* [#96](https://github.com/rubocop/rubocop-minitest/pull/96): Add new `Minitest/UnspecifiedException` cop. ([@fatkodima][])
|
11
|
+
* [#98](https://github.com/rubocop/rubocop-minitest/pull/98): Add new `Minitest/AssertOutput` cop. ([@fatkodima][])
|
12
|
+
* [#84](https://github.com/rubocop/rubocop-minitest/pull/84): New cops `AssertKindOf` and `RefuteKindOf` check for use of `assert_kind_of`/`refute_kind_of` instead of `assert(foo.kind_of?(Class))`/`refute(foo.kind_of?(Class))`. ([@fatkodima][])
|
13
|
+
* [#85](https://github.com/rubocop/rubocop-minitest/pull/85): Add autocorrect to `Rails/AssertEmptyLiteral` cop. ([@fatkodima][])
|
14
14
|
|
15
15
|
### Changes
|
16
16
|
|
17
|
-
* [#104](https://github.com/rubocop
|
17
|
+
* [#104](https://github.com/rubocop/rubocop-minitest/pull/104): Require RuboCop 0.87 or higher. ([@koic][])
|
18
18
|
|
19
19
|
[@fatkodima]: https://github.com/fatkodima
|
20
20
|
[@tsmmark]: https://github.com/tsmmark
|
data/relnotes/v0.10.1.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
### Bug fixes
|
2
2
|
|
3
|
-
* [#106](https://github.com/rubocop
|
3
|
+
* [#106](https://github.com/rubocop/rubocop-minitest/issues/106): Fix an error for `Minitest/AssertOutput` when using gvar at top level. ([@koic][])
|
4
4
|
|
5
5
|
[@koic]: https://github.com/koic
|
data/relnotes/v0.10.2.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
### Bug fixes
|
2
2
|
|
3
|
-
* [#113](https://github.com/rubocop
|
3
|
+
* [#113](https://github.com/rubocop/rubocop-minitest/issues/113): This PR fixes an error for `Minitest/AssertEqual` and some cops when using `assert` with block argument. ([@koic][])
|
4
4
|
|
5
5
|
[@koic]: https://github.com/koic
|
data/relnotes/v0.10.3.md
ADDED
@@ -0,0 +1,5 @@
|
|
1
|
+
### Bug fixes
|
2
|
+
|
3
|
+
* [#115](https://github.com/rubocop/rubocop-minitest/issues/115): Fix a false positive for `Minitest/TestMethodName` for when defining test method has an argument, and test method without assertion methods. ([@koic][])
|
4
|
+
|
5
|
+
[@koic]: https://github.com/koic
|
data/relnotes/v0.11.0.md
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
### New features
|
2
|
+
|
3
|
+
* [#117](https://github.com/rubocop/rubocop-minitest/issues/117): Add new cop `Minitest/AssertWithExpectedArgument` to check for unintended usages of `assert` instead of `assert_equal`. ([@cstyles][])
|
4
|
+
|
5
|
+
### Bug fixes
|
6
|
+
|
7
|
+
* [#122](https://github.com/rubocop/rubocop-minitest/pull/122): Fix `Minitest/TestMethodName` for tests with multiple assertions. ([@ghiculescu][])
|
8
|
+
|
9
|
+
### Changes
|
10
|
+
|
11
|
+
* [#118](https://github.com/rubocop/rubocop-minitest/pull/118): **(BREAKING)** Fix `Minitest/AssertEmptyLiteral` by making it check for `assert_equal([], array)` instead of `assert([], array)`. ([@cstyles][])
|
12
|
+
* [#125](https://github.com/rubocop/rubocop-minitest/pull/125): Require RuboCop 0.90 or higher. ([@koic][])
|
13
|
+
|
14
|
+
[@cstyles]: https://github.com/cstyles
|
15
|
+
[@ghiculescu]: https://github.com/ghiculescu
|
16
|
+
[@koic]: https://github.com/koic
|
data/relnotes/v0.11.1.md
ADDED
data/relnotes/v0.12.0.md
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
### New features
|
2
|
+
|
3
|
+
* [#124](https://github.com/rubocop/rubocop-minitest/pull/124): Add new `Minitest/NoAssertions` cop. ([@ghiculescu][])
|
4
|
+
|
5
|
+
### Changes
|
6
|
+
|
7
|
+
* [#129](https://github.com/rubocop/rubocop-minitest/pull/129): Drop Ruby 2.4 support. ([@koic][])
|
8
|
+
|
9
|
+
[@ghiculescu]: https://github.com/ghiculescu
|
10
|
+
[@koic]: https://github.com/koic
|