rubocop-rspec 1.43.1 → 1.43.2
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: d294600ca379bc470a03a4f321754ddafd18ccc67f405dfe4b7be415d7486354
|
4
|
+
data.tar.gz: 465ba74f6309c23bbe0473a11fff879240f84ae22edce0ce71735e0597d64b93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bc9d6c638aaa87f89af987ffeed7d169becaa8d95a3798442285a5dfdb0fff0150bd092f5fbef047b14366c451f9682a3d1fd8f35c1e2a4f48902d586eff3be
|
7
|
+
data.tar.gz: db4bf7903df2e82900c01d4318dcccdfd10be7ce251d2b472d1fb321f79523505f077d7683325060ad626b82dc52c3ee462ff437a1f7dff668492264f99d45db
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
## Master (Unreleased)
|
4
4
|
|
5
|
+
## 1.43.2 (2020-08-25)
|
6
|
+
|
7
|
+
* Fix `RSpec/FilePath` when checking a file with a shared example. ([@pirj][])
|
8
|
+
* Fix subject nesting detection in `RSpec/LeadingSubject`. ([@pirj][])
|
9
|
+
|
5
10
|
## 1.43.1 (2020-08-17)
|
6
11
|
|
7
12
|
* Fix `RSpec/FilePath` when checking a file defining e.g. an empty class. ([@bquorning][])
|
@@ -69,7 +69,7 @@ module RuboCop
|
|
69
69
|
|
70
70
|
def_node_search :routing_metadata?, '(pair (sym :type) (sym :routing))'
|
71
71
|
|
72
|
-
def
|
72
|
+
def on_top_level_example_group(node)
|
73
73
|
return unless top_level_groups.one?
|
74
74
|
|
75
75
|
const_described(node) do |send_node, described_class, arguments|
|
@@ -54,13 +54,17 @@ module RuboCop
|
|
54
54
|
private
|
55
55
|
|
56
56
|
def offending_node(node)
|
57
|
-
node.
|
57
|
+
parent(node).each_child_node.find do |sibling|
|
58
58
|
break if sibling.equal?(node)
|
59
59
|
|
60
60
|
yield sibling if offending?(sibling)
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
+
def parent(node)
|
65
|
+
node.each_ancestor(:block).first.body
|
66
|
+
end
|
67
|
+
|
64
68
|
def autocorrect(corrector, node, sibling)
|
65
69
|
RuboCop::RSpec::Corrector::MoveNode.new(
|
66
70
|
node, corrector, processed_source
|
@@ -16,7 +16,7 @@ module RuboCop
|
|
16
16
|
return unless root_node
|
17
17
|
|
18
18
|
top_level_groups.each do |node|
|
19
|
-
example_group?(node
|
19
|
+
on_top_level_example_group(node) if example_group?(node)
|
20
20
|
on_top_level_group(node)
|
21
21
|
end
|
22
22
|
end
|
@@ -29,9 +29,9 @@ module RuboCop
|
|
29
29
|
private
|
30
30
|
|
31
31
|
# Dummy methods to be overridden in the consumer
|
32
|
-
def on_top_level_example_group; end
|
32
|
+
def on_top_level_example_group(_node); end
|
33
33
|
|
34
|
-
def on_top_level_group; end
|
34
|
+
def on_top_level_group(_node); end
|
35
35
|
|
36
36
|
def top_level_group?(node)
|
37
37
|
top_level_groups.include?(node)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.43.
|
4
|
+
version: 1.43.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Backus
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-08-
|
13
|
+
date: 2020-08-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rubocop
|