rubocop-minitest 0.34.4 → 0.34.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cc9ea3b370ec30f86a9e1ddb422255552f643a605b6e744518afcfa1e6ae6de0
|
|
4
|
+
data.tar.gz: ba67151e3d30de7f5634ef62feb6663fb0109c69886bdf231417dea06a55ba99
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d7ab44585e54b9cd0cd85d8e36adfd9ba9f9a7b560c791e15af082691e391a38f313857f323eb897c831d277d73b67e13707cdb76db45bce8cf38286099d7640
|
|
7
|
+
data.tar.gz: d592eb50f633074ac727f0fb493d734ca70320ff8fb9441dfab46b45916a7d730a5e439486642755cc83797bacbdfaf85cbb6b6cc95415a491230f64e2645102
|
data/config/default.yml
CHANGED
|
@@ -46,6 +46,7 @@ Minitest/AssertKindOf:
|
|
|
46
46
|
StyleGuide: 'https://github.com/rubocop/minitest-style-guide#assert-kind-of'
|
|
47
47
|
Enabled: 'pending'
|
|
48
48
|
VersionAdded: '0.10'
|
|
49
|
+
VersionChanged: '0.34'
|
|
49
50
|
|
|
50
51
|
Minitest/AssertMatch:
|
|
51
52
|
Description: 'This cop enforces the test to use `assert_match` instead of using `assert(matcher.match(object))`.'
|
|
@@ -252,6 +253,7 @@ Minitest/RefuteKindOf:
|
|
|
252
253
|
StyleGuide: 'https://github.com/rubocop/minitest-style-guide#refute-kind-of'
|
|
253
254
|
Enabled: 'pending'
|
|
254
255
|
VersionAdded: '0.10'
|
|
256
|
+
VersionChanged: '0.34'
|
|
255
257
|
|
|
256
258
|
Minitest/RefuteMatch:
|
|
257
259
|
Description: 'This cop enforces the test to use `refute_match` instead of using `refute(matcher.match(object))`.'
|
|
@@ -11,6 +11,11 @@ module RuboCop
|
|
|
11
11
|
# assert(object.kind_of?(Class))
|
|
12
12
|
# assert(object.kind_of?(Class), 'message')
|
|
13
13
|
#
|
|
14
|
+
# # bad
|
|
15
|
+
# # `is_a?` is an alias for `kind_of?`
|
|
16
|
+
# assert(object.is_a?(Class))
|
|
17
|
+
# assert(object.is_a?(Class), 'message')
|
|
18
|
+
#
|
|
14
19
|
# # good
|
|
15
20
|
# assert_kind_of(Class, object)
|
|
16
21
|
# assert_kind_of(Class, object, 'message')
|
|
@@ -18,7 +23,7 @@ module RuboCop
|
|
|
18
23
|
class AssertKindOf < Base
|
|
19
24
|
extend MinitestCopRule
|
|
20
25
|
|
|
21
|
-
define_rule :assert, target_method:
|
|
26
|
+
define_rule :assert, target_method: %i[kind_of? is_a?], preferred_method: :assert_kind_of, inverse: true
|
|
22
27
|
end
|
|
23
28
|
end
|
|
24
29
|
end
|
|
@@ -11,6 +11,11 @@ module RuboCop
|
|
|
11
11
|
# refute(object.kind_of?(Class))
|
|
12
12
|
# refute(object.kind_of?(Class), 'message')
|
|
13
13
|
#
|
|
14
|
+
# # bad
|
|
15
|
+
# # `is_a?` is an alias for `kind_of?`
|
|
16
|
+
# refute(object.is_of?(Class))
|
|
17
|
+
# refute(object.is_of?(Class), 'message')
|
|
18
|
+
#
|
|
14
19
|
# # good
|
|
15
20
|
# refute_kind_of(Class, object)
|
|
16
21
|
# refute_kind_of(Class, object, 'message')
|
|
@@ -18,7 +23,7 @@ module RuboCop
|
|
|
18
23
|
class RefuteKindOf < Base
|
|
19
24
|
extend MinitestCopRule
|
|
20
25
|
|
|
21
|
-
define_rule :refute, target_method:
|
|
26
|
+
define_rule :refute, target_method: %i[kind_of? is_a?], preferred_method: :refute_kind_of, inverse: true
|
|
22
27
|
end
|
|
23
28
|
end
|
|
24
29
|
end
|
|
@@ -48,7 +48,7 @@ module RuboCop
|
|
|
48
48
|
when *SINGLE_ASSERTION_ARGUMENT_METHODS
|
|
49
49
|
actual.nil? && expected&.literal? && !expected.xstr_type?
|
|
50
50
|
when *TWO_ASSERTION_ARGUMENTS_METHODS
|
|
51
|
-
return false unless expected
|
|
51
|
+
return false unless expected && actual
|
|
52
52
|
return false if expected.source != actual.source
|
|
53
53
|
|
|
54
54
|
(expected.variable? && actual.variable?) ||
|
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.34.
|
|
4
|
+
version: 0.34.5
|
|
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: 2024-01-
|
|
13
|
+
date: 2024-01-20 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: rubocop
|