rubocop-minitest 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +2 -1
- data/.rubocop_todo.yml +5 -5
- data/CHANGELOG.md +4 -0
- data/Gemfile +4 -1
- data/lib/rubocop/cop/minitest/assert_empty.rb +5 -5
- data/lib/rubocop/cop/minitest/assert_equal.rb +8 -13
- data/lib/rubocop/cop/minitest/assert_includes.rb +6 -5
- data/lib/rubocop/cop/minitest/assert_instance_of.rb +7 -8
- data/lib/rubocop/cop/minitest/assert_nil.rb +8 -3
- data/lib/rubocop/cop/minitest/assert_respond_to.rb +8 -5
- data/lib/rubocop/cop/minitest/assert_truthy.rb +8 -3
- data/lib/rubocop/cop/minitest/refute_empty.rb +5 -5
- data/lib/rubocop/cop/minitest/refute_equal.rb +7 -8
- data/lib/rubocop/cop/minitest/refute_false.rb +8 -3
- data/lib/rubocop/cop/minitest/refute_includes.rb +6 -5
- data/lib/rubocop/cop/minitest/refute_instance_of.rb +7 -8
- data/lib/rubocop/cop/minitest/refute_nil.rb +8 -3
- data/lib/rubocop/cop/minitest/refute_respond_to.rb +8 -5
- data/lib/rubocop/cop/minitest_cops.rb +1 -0
- data/lib/rubocop/cop/mixin/argument_range_helper.rb +31 -0
- data/lib/rubocop/minitest/version.rb +1 -1
- data/relnotes/v0.5.1.md +3 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3c643f7623a14a4a99f813daf392e31a491b7177504cad25760093d80e0b32e
|
4
|
+
data.tar.gz: b2e5de6e39a741828ae69ca48311b366747bb19aebbc85b23c96ff346f180b39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eada0f53e4b625d321342f22aa80942512fcefa2131443a7d7d1d7a6f9fafabc1f1e8659f7b7fd2cc002bf83dcec037e760def29db035ac2f1e29bb6ace5fba3
|
7
|
+
data.tar.gz: ca010bc26330c8c32a9a28fe12f27870affa6e554c6832b6eedede0daf4c89fd5e28ffd93bca1e152a5e3785240023db9e4d35226f3e1bcfc02f49a7cffc5c68
|
data/.github/FUNDING.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2019-
|
3
|
+
# on 2019-12-21 01:15:41 +0900 using RuboCop version 0.78.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
@@ -10,14 +10,14 @@
|
|
10
10
|
Metrics/AbcSize:
|
11
11
|
Max: 17
|
12
12
|
|
13
|
-
# Offense count:
|
13
|
+
# Offense count: 19
|
14
14
|
# Configuration parameters: CountComments, ExcludedMethods.
|
15
15
|
Metrics/MethodLength:
|
16
16
|
Max: 14
|
17
17
|
|
18
|
-
# Offense count:
|
18
|
+
# Offense count: 40
|
19
19
|
# Cop supports --auto-correct.
|
20
20
|
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
21
21
|
# URISchemes: http, https
|
22
|
-
|
23
|
-
Max:
|
22
|
+
Layout/LineLength:
|
23
|
+
Max: 90
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
4
|
|
5
|
+
## 0.5.1 (2019-12-25)
|
6
|
+
|
7
|
+
* [#42](https://github.com/rubocop-hq/rubocop-minitest/issues/42): Fix an incorrect autocorrect for some cops of `Minitest` department when using heredoc message. ([@koic][])
|
8
|
+
|
5
9
|
## 0.5.0 (2019-11-24)
|
6
10
|
|
7
11
|
### New features
|
data/Gemfile
CHANGED
@@ -10,4 +10,7 @@ gem 'bump', require: false
|
|
10
10
|
gem 'rake'
|
11
11
|
gem 'rubocop', github: 'rubocop-hq/rubocop'
|
12
12
|
gem 'rubocop-performance', '~> 1.5.0'
|
13
|
-
|
13
|
+
# Workaround for YARD 0.9.20 or lower.
|
14
|
+
# It specifies `github` until the release that includes the following changes:
|
15
|
+
# https://github.com/lsegal/yard/pull/1290
|
16
|
+
gem 'yard', github: 'lsegal/yard', ref: '10a2e5b'
|
@@ -16,6 +16,8 @@ module RuboCop
|
|
16
16
|
# assert_empty(object, 'the message')
|
17
17
|
#
|
18
18
|
class AssertEmpty < Cop
|
19
|
+
include ArgumentRangeHelper
|
20
|
+
|
19
21
|
MSG = 'Prefer using `assert_empty(%<arguments>s)` over ' \
|
20
22
|
'`assert(%<receiver>s)`.'
|
21
23
|
|
@@ -37,11 +39,9 @@ module RuboCop
|
|
37
39
|
|
38
40
|
def autocorrect(node)
|
39
41
|
lambda do |corrector|
|
40
|
-
assert_with_empty(node) do |
|
41
|
-
|
42
|
-
|
43
|
-
replacement = [actual.source, message&.source].compact.join(', ')
|
44
|
-
corrector.replace(node.loc.expression, "assert_empty(#{replacement})")
|
42
|
+
assert_with_empty(node) do |_, actual_arg|
|
43
|
+
corrector.replace(node.loc.selector, 'assert_empty')
|
44
|
+
corrector.replace(first_argument_range(node), actual_arg.source)
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
@@ -14,6 +14,8 @@ module RuboCop
|
|
14
14
|
# assert_equal("rubocop-minitest", actual)
|
15
15
|
#
|
16
16
|
class AssertEqual < Cop
|
17
|
+
include ArgumentRangeHelper
|
18
|
+
|
17
19
|
MSG = 'Prefer using `assert_equal(%<preferred>s)` over ' \
|
18
20
|
'`assert(%<over>s)`.'
|
19
21
|
|
@@ -22,9 +24,7 @@ module RuboCop
|
|
22
24
|
PATTERN
|
23
25
|
|
24
26
|
def on_send(node)
|
25
|
-
assert_equal(node) do
|
26
|
-
|first_receiver_arg, expected, actual, rest_receiver_arg|
|
27
|
-
|
27
|
+
assert_equal(node) do |first_receiver_arg, expected, actual, rest_receiver_arg|
|
28
28
|
message = rest_receiver_arg.first
|
29
29
|
preferred = [expected.source, actual.source, message&.source]
|
30
30
|
.compact.join(', ')
|
@@ -38,19 +38,14 @@ module RuboCop
|
|
38
38
|
|
39
39
|
def autocorrect(node)
|
40
40
|
lambda do |corrector|
|
41
|
-
assert_equal(node) do |
|
42
|
-
|
43
|
-
|
44
|
-
|
41
|
+
assert_equal(node) do |_, expected, actual|
|
42
|
+
corrector.replace(node.loc.selector, 'assert_equal')
|
43
|
+
|
44
|
+
replacement = [expected, actual].map(&:source).join(', ')
|
45
|
+
corrector.replace(first_argument_range(node), replacement)
|
45
46
|
end
|
46
47
|
end
|
47
48
|
end
|
48
|
-
|
49
|
-
private
|
50
|
-
|
51
|
-
def node_arguments(expected, actual, message)
|
52
|
-
[expected.source, actual.source, message&.source].compact.join(', ')
|
53
|
-
end
|
54
49
|
end
|
55
50
|
end
|
56
51
|
end
|
@@ -16,6 +16,8 @@ module RuboCop
|
|
16
16
|
# assert_includes(collection, object, 'the message')
|
17
17
|
#
|
18
18
|
class AssertIncludes < Cop
|
19
|
+
include ArgumentRangeHelper
|
20
|
+
|
19
21
|
MSG = 'Prefer using `assert_includes(%<arguments>s)` over ' \
|
20
22
|
'`assert(%<receiver>s)`.'
|
21
23
|
|
@@ -39,12 +41,11 @@ module RuboCop
|
|
39
41
|
|
40
42
|
def autocorrect(node)
|
41
43
|
lambda do |corrector|
|
42
|
-
assert_with_includes(node) do
|
43
|
-
|
44
|
+
assert_with_includes(node) do |_, collection, actual|
|
45
|
+
corrector.replace(node.loc.selector, 'assert_includes')
|
44
46
|
|
45
|
-
|
46
|
-
|
47
|
-
corrector.replace(node.loc.expression, "assert_includes(#{replacement})")
|
47
|
+
replacement = [collection, actual].map(&:source).join(', ')
|
48
|
+
corrector.replace(first_argument_range(node), replacement)
|
48
49
|
end
|
49
50
|
end
|
50
51
|
end
|
@@ -16,6 +16,8 @@ module RuboCop
|
|
16
16
|
# assert_instance_of(Class, object, 'the message')
|
17
17
|
#
|
18
18
|
class AssertInstanceOf < Cop
|
19
|
+
include ArgumentRangeHelper
|
20
|
+
|
19
21
|
MSG = 'Prefer using `assert_instance_of(%<arguments>s)` over ' \
|
20
22
|
'`assert(%<receiver>s)`.'
|
21
23
|
|
@@ -24,9 +26,7 @@ module RuboCop
|
|
24
26
|
PATTERN
|
25
27
|
|
26
28
|
def on_send(node)
|
27
|
-
assert_with_instance_of(node) do
|
28
|
-
|first_receiver_arg, object, method, rest_args|
|
29
|
-
|
29
|
+
assert_with_instance_of(node) do |first_receiver_arg, object, method, rest_args|
|
30
30
|
message = rest_args.first
|
31
31
|
arguments = node_arguments(object, method, message)
|
32
32
|
receiver = [first_receiver_arg.source, message&.source].compact.join(', ')
|
@@ -39,12 +39,11 @@ module RuboCop
|
|
39
39
|
|
40
40
|
def autocorrect(node)
|
41
41
|
lambda do |corrector|
|
42
|
-
assert_with_instance_of(node) do |_, object, method
|
43
|
-
|
44
|
-
arguments = node_arguments(object, method, message)
|
42
|
+
assert_with_instance_of(node) do |_, object, method|
|
43
|
+
corrector.replace(node.loc.selector, 'assert_instance_of')
|
45
44
|
|
46
|
-
replacement =
|
47
|
-
corrector.replace(node
|
45
|
+
replacement = [method, object].map(&:source).join(', ')
|
46
|
+
corrector.replace(first_argument_range(node), replacement)
|
48
47
|
end
|
49
48
|
end
|
50
49
|
end
|
@@ -16,6 +16,8 @@ module RuboCop
|
|
16
16
|
# assert_nil(actual, 'the message')
|
17
17
|
#
|
18
18
|
class AssertNil < Cop
|
19
|
+
include ArgumentRangeHelper
|
20
|
+
|
19
21
|
MSG = 'Prefer using `assert_nil(%<arguments>s)` over ' \
|
20
22
|
'`assert_equal(nil, %<arguments>s)`.'
|
21
23
|
|
@@ -35,9 +37,12 @@ module RuboCop
|
|
35
37
|
|
36
38
|
def autocorrect(node)
|
37
39
|
lambda do |corrector|
|
38
|
-
|
39
|
-
|
40
|
-
|
40
|
+
assert_equal_with_nil(node) do |actual|
|
41
|
+
corrector.replace(node.loc.selector, 'assert_nil')
|
42
|
+
corrector.replace(
|
43
|
+
first_and_second_arguments_range(node), actual.source
|
44
|
+
)
|
45
|
+
end
|
41
46
|
end
|
42
47
|
end
|
43
48
|
end
|
@@ -18,6 +18,8 @@ module RuboCop
|
|
18
18
|
# assert_respond_to(self, some_method)
|
19
19
|
#
|
20
20
|
class AssertRespondTo < Cop
|
21
|
+
include ArgumentRangeHelper
|
22
|
+
|
21
23
|
MSG = 'Prefer using `assert_respond_to(%<preferred>s)` over ' \
|
22
24
|
'`assert(%<over>s)`.'
|
23
25
|
|
@@ -37,11 +39,12 @@ module RuboCop
|
|
37
39
|
|
38
40
|
def autocorrect(node)
|
39
41
|
lambda do |corrector|
|
40
|
-
assert_with_respond_to(node) do |_, object, method
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
assert_with_respond_to(node) do |_, object, method|
|
43
|
+
corrector.replace(node.loc.selector, 'assert_respond_to')
|
44
|
+
|
45
|
+
object = object ? object.source : 'self'
|
46
|
+
replacement = [object, method.source].join(', ')
|
47
|
+
corrector.replace(first_argument_range(node), replacement)
|
45
48
|
end
|
46
49
|
end
|
47
50
|
end
|
@@ -16,6 +16,8 @@ module RuboCop
|
|
16
16
|
# assert(actual, 'the message')
|
17
17
|
#
|
18
18
|
class AssertTruthy < Cop
|
19
|
+
include ArgumentRangeHelper
|
20
|
+
|
19
21
|
MSG = 'Prefer using `assert(%<arguments>s)` over ' \
|
20
22
|
'`assert_equal(true, %<arguments>s)`.'
|
21
23
|
|
@@ -35,9 +37,12 @@ module RuboCop
|
|
35
37
|
|
36
38
|
def autocorrect(node)
|
37
39
|
lambda do |corrector|
|
38
|
-
|
39
|
-
|
40
|
-
|
40
|
+
assert_equal_with_truthy(node) do |actual|
|
41
|
+
corrector.replace(node.loc.selector, 'assert')
|
42
|
+
corrector.replace(
|
43
|
+
first_and_second_arguments_range(node), actual.source
|
44
|
+
)
|
45
|
+
end
|
41
46
|
end
|
42
47
|
end
|
43
48
|
end
|
@@ -16,6 +16,8 @@ module RuboCop
|
|
16
16
|
# refute_empty(object, 'the message')
|
17
17
|
#
|
18
18
|
class RefuteEmpty < Cop
|
19
|
+
include ArgumentRangeHelper
|
20
|
+
|
19
21
|
MSG = 'Prefer using `refute_empty(%<arguments>s)` over ' \
|
20
22
|
'`refute(%<receiver>s)`.'
|
21
23
|
|
@@ -37,11 +39,9 @@ module RuboCop
|
|
37
39
|
|
38
40
|
def autocorrect(node)
|
39
41
|
lambda do |corrector|
|
40
|
-
refute_with_empty(node) do |
|
41
|
-
|
42
|
-
|
43
|
-
replacement = [object.source, message&.source].compact.join(', ')
|
44
|
-
corrector.replace(node.loc.expression, "refute_empty(#{replacement})")
|
42
|
+
refute_with_empty(node) do |_, actual_arg|
|
43
|
+
corrector.replace(node.loc.selector, 'refute_empty')
|
44
|
+
corrector.replace(first_argument_range(node), actual_arg.source)
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
@@ -15,6 +15,8 @@ module RuboCop
|
|
15
15
|
# refute_equal("rubocop-minitest", actual)
|
16
16
|
#
|
17
17
|
class RefuteEqual < Cop
|
18
|
+
include ArgumentRangeHelper
|
19
|
+
|
18
20
|
MSG = 'Prefer using `refute_equal(%<preferred>s)` over ' \
|
19
21
|
'`assert(%<over>s)`.'
|
20
22
|
|
@@ -32,20 +34,17 @@ module RuboCop
|
|
32
34
|
|
33
35
|
def autocorrect(node)
|
34
36
|
lambda do |corrector|
|
35
|
-
assert_not_equal(node) do |_,
|
36
|
-
|
37
|
+
assert_not_equal(node) do |_, expected, actual|
|
38
|
+
corrector.replace(node.loc.selector, 'refute_equal')
|
39
|
+
|
40
|
+
replacement = [expected, actual].map(&:source).join(', ')
|
41
|
+
corrector.replace(first_argument_range(node), replacement)
|
37
42
|
end
|
38
43
|
end
|
39
44
|
end
|
40
45
|
|
41
46
|
private
|
42
47
|
|
43
|
-
def autocorrect_node(node, corrector, first_arg, second_arg, rest_args)
|
44
|
-
custom_message = rest_args.first
|
45
|
-
replacement = preferred_usage(first_arg, second_arg, custom_message)
|
46
|
-
corrector.replace(node.loc.expression, "refute_equal(#{replacement})")
|
47
|
-
end
|
48
|
-
|
49
48
|
def preferred_usage(first_arg, second_arg, custom_message = nil)
|
50
49
|
[first_arg, second_arg, custom_message]
|
51
50
|
.compact.map(&:source).join(', ')
|
@@ -16,6 +16,8 @@ module RuboCop
|
|
16
16
|
# refute(actual, 'the message')
|
17
17
|
#
|
18
18
|
class RefuteFalse < Cop
|
19
|
+
include ArgumentRangeHelper
|
20
|
+
|
19
21
|
MSG = 'Prefer using `refute(%<arguments>s)` over ' \
|
20
22
|
'`assert_equal(false, %<arguments>s)`.'
|
21
23
|
|
@@ -35,9 +37,12 @@ module RuboCop
|
|
35
37
|
|
36
38
|
def autocorrect(node)
|
37
39
|
lambda do |corrector|
|
38
|
-
|
39
|
-
|
40
|
-
|
40
|
+
assert_equal_with_false(node) do |actual|
|
41
|
+
corrector.replace(node.loc.selector, 'refute')
|
42
|
+
corrector.replace(
|
43
|
+
first_and_second_arguments_range(node), actual.source
|
44
|
+
)
|
45
|
+
end
|
41
46
|
end
|
42
47
|
end
|
43
48
|
end
|
@@ -16,6 +16,8 @@ module RuboCop
|
|
16
16
|
# refute_includes(collection, object, 'the message')
|
17
17
|
#
|
18
18
|
class RefuteIncludes < Cop
|
19
|
+
include ArgumentRangeHelper
|
20
|
+
|
19
21
|
MSG = 'Prefer using `refute_includes(%<arguments>s)` over ' \
|
20
22
|
'`refute(%<receiver>s)`.'
|
21
23
|
|
@@ -39,12 +41,11 @@ module RuboCop
|
|
39
41
|
|
40
42
|
def autocorrect(node)
|
41
43
|
lambda do |corrector|
|
42
|
-
refute_with_includes(node) do
|
43
|
-
|
44
|
+
refute_with_includes(node) do |_, collection, actual|
|
45
|
+
corrector.replace(node.loc.selector, 'refute_includes')
|
44
46
|
|
45
|
-
|
46
|
-
|
47
|
-
corrector.replace(node.loc.expression, "refute_includes(#{replacement})")
|
47
|
+
replacement = [collection, actual].map(&:source).join(', ')
|
48
|
+
corrector.replace(first_argument_range(node), replacement)
|
48
49
|
end
|
49
50
|
end
|
50
51
|
end
|
@@ -16,6 +16,8 @@ module RuboCop
|
|
16
16
|
# refute_instance_of(Class, object, 'the message')
|
17
17
|
#
|
18
18
|
class RefuteInstanceOf < Cop
|
19
|
+
include ArgumentRangeHelper
|
20
|
+
|
19
21
|
MSG = 'Prefer using `refute_instance_of(%<arguments>s)` over ' \
|
20
22
|
'`refute(%<receiver>s)`.'
|
21
23
|
|
@@ -24,9 +26,7 @@ module RuboCop
|
|
24
26
|
PATTERN
|
25
27
|
|
26
28
|
def on_send(node)
|
27
|
-
refute_with_instance_of(node) do
|
28
|
-
|first_receiver_arg, object, method, rest_args|
|
29
|
-
|
29
|
+
refute_with_instance_of(node) do |first_receiver_arg, object, method, rest_args|
|
30
30
|
message = rest_args.first
|
31
31
|
arguments = node_arguments(object, method, message)
|
32
32
|
receiver = [first_receiver_arg.source, message&.source].compact.join(', ')
|
@@ -39,12 +39,11 @@ module RuboCop
|
|
39
39
|
|
40
40
|
def autocorrect(node)
|
41
41
|
lambda do |corrector|
|
42
|
-
refute_with_instance_of(node) do |_, object, method
|
43
|
-
|
44
|
-
arguments = node_arguments(object, method, message)
|
42
|
+
refute_with_instance_of(node) do |_, object, method|
|
43
|
+
corrector.replace(node.loc.selector, 'refute_instance_of')
|
45
44
|
|
46
|
-
replacement =
|
47
|
-
corrector.replace(node
|
45
|
+
replacement = [method, object].map(&:source).join(', ')
|
46
|
+
corrector.replace(first_argument_range(node), replacement)
|
48
47
|
end
|
49
48
|
end
|
50
49
|
end
|
@@ -16,6 +16,8 @@ module RuboCop
|
|
16
16
|
# refute_nil(actual, 'the message')
|
17
17
|
#
|
18
18
|
class RefuteNil < Cop
|
19
|
+
include ArgumentRangeHelper
|
20
|
+
|
19
21
|
MSG = 'Prefer using `refute_nil(%<arguments>s)` over ' \
|
20
22
|
'`refute_equal(nil, %<arguments>s)`.'
|
21
23
|
|
@@ -35,9 +37,12 @@ module RuboCop
|
|
35
37
|
|
36
38
|
def autocorrect(node)
|
37
39
|
lambda do |corrector|
|
38
|
-
|
39
|
-
|
40
|
-
|
40
|
+
refute_equal_with_nil(node) do |actual|
|
41
|
+
corrector.replace(node.loc.selector, 'refute_nil')
|
42
|
+
corrector.replace(
|
43
|
+
first_and_second_arguments_range(node), actual.source
|
44
|
+
)
|
45
|
+
end
|
41
46
|
end
|
42
47
|
end
|
43
48
|
end
|
@@ -18,6 +18,8 @@ module RuboCop
|
|
18
18
|
# refute_respond_to(self, :some_method)
|
19
19
|
#
|
20
20
|
class RefuteRespondTo < Cop
|
21
|
+
include ArgumentRangeHelper
|
22
|
+
|
21
23
|
MSG = 'Prefer using `refute_respond_to(%<preferred>s)` over ' \
|
22
24
|
'`refute(%<over>s)`.'
|
23
25
|
|
@@ -37,11 +39,12 @@ module RuboCop
|
|
37
39
|
|
38
40
|
def autocorrect(node)
|
39
41
|
lambda do |corrector|
|
40
|
-
refute_with_respond_to(node) do |_, object, method
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
refute_with_respond_to(node) do |_, object, method|
|
43
|
+
corrector.replace(node.loc.selector, 'refute_respond_to')
|
44
|
+
|
45
|
+
object = object ? object.source : 'self'
|
46
|
+
replacement = [object, method.source].join(', ')
|
47
|
+
corrector.replace(first_argument_range(node), replacement)
|
45
48
|
end
|
46
49
|
end
|
47
50
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module Cop
|
5
|
+
# Methods that calculate and return `Parser::Source::Ranges`.
|
6
|
+
module ArgumentRangeHelper
|
7
|
+
include RangeHelp
|
8
|
+
|
9
|
+
private
|
10
|
+
|
11
|
+
def first_argument_range(node)
|
12
|
+
first_argument = node.first_argument
|
13
|
+
|
14
|
+
range_between(
|
15
|
+
first_argument.source_range.begin_pos,
|
16
|
+
first_argument.source_range.end_pos
|
17
|
+
)
|
18
|
+
end
|
19
|
+
|
20
|
+
def first_and_second_arguments_range(node)
|
21
|
+
first_argument = node.first_argument
|
22
|
+
second_argument = node.arguments[1]
|
23
|
+
|
24
|
+
range_between(
|
25
|
+
first_argument.source_range.begin_pos,
|
26
|
+
second_argument.source_range.end_pos
|
27
|
+
)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/relnotes/v0.5.1.md
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-minitest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bozhidar Batsov
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2019-
|
13
|
+
date: 2019-12-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rubocop
|
@@ -82,6 +82,7 @@ files:
|
|
82
82
|
- lib/rubocop/cop/minitest/refute_nil.rb
|
83
83
|
- lib/rubocop/cop/minitest/refute_respond_to.rb
|
84
84
|
- lib/rubocop/cop/minitest_cops.rb
|
85
|
+
- lib/rubocop/cop/mixin/argument_range_helper.rb
|
85
86
|
- lib/rubocop/minitest.rb
|
86
87
|
- lib/rubocop/minitest/inject.rb
|
87
88
|
- lib/rubocop/minitest/version.rb
|
@@ -99,6 +100,7 @@ files:
|
|
99
100
|
- relnotes/v0.4.0.md
|
100
101
|
- relnotes/v0.4.1.md
|
101
102
|
- relnotes/v0.5.0.md
|
103
|
+
- relnotes/v0.5.1.md
|
102
104
|
- rubocop-minitest.gemspec
|
103
105
|
- tasks/cops_documentation.rake
|
104
106
|
- tasks/cut_release.rake
|
@@ -126,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
128
|
- !ruby/object:Gem::Version
|
127
129
|
version: '0'
|
128
130
|
requirements: []
|
129
|
-
rubygems_version: 3.
|
131
|
+
rubygems_version: 3.1.2
|
130
132
|
signing_key:
|
131
133
|
specification_version: 4
|
132
134
|
summary: Automatic Minitest code style checking tool.
|