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: f4a711b9695e84aeeb5dd5775251d1de3bb4e2517e4d9489e4fe8df85095be2d
4
- data.tar.gz: 7f45719f6b6f89106003d5af2b4f4add6374b0d558220d9eb10974e9d944a043
3
+ metadata.gz: d294600ca379bc470a03a4f321754ddafd18ccc67f405dfe4b7be415d7486354
4
+ data.tar.gz: 465ba74f6309c23bbe0473a11fff879240f84ae22edce0ce71735e0597d64b93
5
5
  SHA512:
6
- metadata.gz: 25069ce548603cbea393b93ac9047b3356b3dea575f2007a3f385a88c27c7112f127b3871ea0472fa45a207c08e9d41fb0e9e5702aaa1cb9bb4de21093257212
7
- data.tar.gz: 74e4fcf11b03a47c29ef8959fef7faa44215d3177c7184e2e2473f24a9b8cffa3eb71f6e42c9dc8610b159813c63ccde4f17f5a9d858b686082893d8d006ceba
6
+ metadata.gz: 6bc9d6c638aaa87f89af987ffeed7d169becaa8d95a3798442285a5dfdb0fff0150bd092f5fbef047b14366c451f9682a3d1fd8f35c1e2a4f48902d586eff3be
7
+ data.tar.gz: db4bf7903df2e82900c01d4318dcccdfd10be7ce251d2b472d1fb321f79523505f077d7683325060ad626b82dc52c3ee462ff437a1f7dff668492264f99d45db
@@ -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 on_top_level_group(node)
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.parent.each_child_node.find do |sibling|
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, &method(:on_top_level_example_group))
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)
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module RSpec
5
5
  # Version information for the RSpec RuboCop plugin.
6
6
  module Version
7
- STRING = '1.43.1'
7
+ STRING = '1.43.2'
8
8
  end
9
9
  end
10
10
  end
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.1
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-17 00:00:00.000000000 Z
13
+ date: 2020-08-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubocop