rubocop-minitest 0.28.0 → 0.29.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 938714064905717403a5e63e0cfcca49356b3240c85f2fc26247faefa08ff65f
|
4
|
+
data.tar.gz: 2db37113c89cc16952a020d3a42f4cf3b94ee067b85b3460c0ef9786c69fe338
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9322ed01a4e6598b65742584421c1e92609d8340e6e077df7eb4126abdf842e646ff33a7ae6577ab1649bc2a9ab212645d607fe3db467596a0e8d61517f823e
|
7
|
+
data.tar.gz: bd62a8d102301b4898ab9c23696b8159bb0ba4c3257d37c7e91ba70263d72bf887cfb257e6e0fa060101305f011cf707d47fa69c82e9b1ce4701a47252ab7b35
|
@@ -36,8 +36,7 @@ module RuboCop
|
|
36
36
|
private
|
37
37
|
|
38
38
|
def find_test_case(node)
|
39
|
-
|
40
|
-
def_ancestor if test_case?(def_ancestor)
|
39
|
+
node.each_ancestor.find { |ancestor| test_case?(ancestor) }
|
41
40
|
end
|
42
41
|
|
43
42
|
def references_gvar?(assertion, gvar_name)
|
@@ -30,22 +30,23 @@ module RuboCop
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def test_case?(node)
|
33
|
-
return false unless node&.def_type? && test_method?(node)
|
33
|
+
return false unless (node&.def_type? && test_method?(node)) ||
|
34
|
+
(node&.block_type? && test_block?(node))
|
34
35
|
|
35
36
|
class_ancestor = node.each_ancestor(:class).first
|
36
37
|
test_class?(class_ancestor)
|
37
38
|
end
|
38
39
|
|
39
40
|
def test_cases(class_node, visibility_check: true)
|
40
|
-
|
41
|
+
test_methods = class_def_nodes(class_node).select do |def_node|
|
41
42
|
test_method?(def_node, visibility_check: visibility_check)
|
42
43
|
end
|
43
44
|
|
44
45
|
# Support Active Support's `test 'example' { ... }` method.
|
45
46
|
# https://api.rubyonrails.org/classes/ActiveSupport/Testing/Declarative.html
|
46
|
-
test_blocks = class_node.each_descendant(:block).select { |
|
47
|
+
test_blocks = class_node.each_descendant(:block).select { |block_node| test_block?(block_node) }
|
47
48
|
|
48
|
-
|
49
|
+
test_methods + test_blocks
|
49
50
|
end
|
50
51
|
|
51
52
|
def test_method?(def_node, visibility_check: true)
|
@@ -54,6 +55,10 @@ module RuboCop
|
|
54
55
|
test_case_name?(def_node.method_name) && !def_node.arguments?
|
55
56
|
end
|
56
57
|
|
58
|
+
def test_block?(block_node)
|
59
|
+
block_node.method?(:test) || block_node.method?(:it)
|
60
|
+
end
|
61
|
+
|
57
62
|
def lifecycle_hooks(class_node)
|
58
63
|
class_def_nodes(class_node)
|
59
64
|
.select { |def_node| lifecycle_hook_method?(def_node) }
|
@@ -124,7 +124,7 @@ module RuboCop
|
|
124
124
|
end
|
125
125
|
|
126
126
|
def _investigate(cop, processed_source)
|
127
|
-
team = RuboCop::Cop::Team.new([cop],
|
127
|
+
team = RuboCop::Cop::Team.new([cop], configuration, raise_error: true)
|
128
128
|
report = team.investigate(processed_source)
|
129
129
|
@last_corrector = report.correctors.first || RuboCop::Cop::Corrector.new(processed_source)
|
130
130
|
report.offenses
|
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.
|
4
|
+
version: 0.29.0
|
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: 2023-
|
13
|
+
date: 2023-03-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rubocop
|
@@ -112,7 +112,7 @@ metadata:
|
|
112
112
|
homepage_uri: https://docs.rubocop.org/rubocop-minitest/
|
113
113
|
changelog_uri: https://github.com/rubocop/rubocop-minitest/blob/master/CHANGELOG.md
|
114
114
|
source_code_uri: https://github.com/rubocop/rubocop-minitest
|
115
|
-
documentation_uri: https://docs.rubocop.org/rubocop-minitest/0.
|
115
|
+
documentation_uri: https://docs.rubocop.org/rubocop-minitest/0.29
|
116
116
|
bug_tracker_uri: https://github.com/rubocop/rubocop-minitest/issues
|
117
117
|
rubygems_mfa_required: 'true'
|
118
118
|
post_install_message:
|