rubocop-rspec 1.9.0 → 1.9.1

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
  SHA1:
3
- metadata.gz: d160e862b58dbfd9bcd2ae0966bd185d1ed13d25
4
- data.tar.gz: 3b32f0c16a19b8f110e40d79f4a87d510e3c9226
3
+ metadata.gz: 7161e38d3d46174e4acad35bf1ab6b7fdd8d62d4
4
+ data.tar.gz: d9b7e70692513359abc3501795939c31075bd3dc
5
5
  SHA512:
6
- metadata.gz: b429eb8553d36a1aec8613f57a4f3356518acb89ade8e41f96093dc6ba430b592b3a35899dcefe8df5833a1c0ceb7afa8d3bf1431ad554ffaeb057b2775df622
7
- data.tar.gz: 4bc98868826de4ba820c107b5507beb1b57259d147199cec394054c5ac6887786ba1db1ce396bfcfe8ed345387b736b73b18c8b0e1bf0f3b3841f665e7f23064
6
+ metadata.gz: 7d57d6b57e5333d78635bcc4282ece219f7c2ebc0b7ed394e65da9a4167861752ec69bc4e588038737c21af69b1cfe86959d82fef02cce16e9dccd2ef9718fd0
7
+ data.tar.gz: d961bdccd80bab88bb0c04f00c2e27003e7203aa212a0ec12f8403455e522d8b85b7171e0fd27e495dd524569df2246f3590dd660db7974997f052160f51c91b
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Master (unreleased)
4
4
 
5
+ ## 1.9.1 (2017-01-02)
6
+
7
+ * Fix unintentional regression change in `NestedGroups` reported in #270. ([@backus][])
8
+ * Change `MaxNesting` for `NestedGroups` from 2 to 3. ([@backus][])
9
+
5
10
  ## 1.9.0 (2016-12-29)
6
11
 
7
12
  * Add `MessageSpies` cop for enforcing consistent style of either `expect(...).to have_received` or `expect(...).to receive`, intended as a replacement for the `MessageExpectation` cop. ([@bquorning][])
data/config/default.yml CHANGED
@@ -127,7 +127,7 @@ RSpec/NamedSubject:
127
127
  RSpec/NestedGroups:
128
128
  Description: Checks for nested example groups.
129
129
  Enabled: true
130
- MaxNesting: 2
130
+ MaxNesting: 3
131
131
 
132
132
  RSpec/NotToNot:
133
133
  Description: Checks for consistent method usage for negating expectations.
@@ -77,7 +77,7 @@ module RuboCop
77
77
  end
78
78
 
79
79
  def max_expectations
80
- Integer(cop_config.fetch(parameter_name, 1))
80
+ Integer(cop_config.fetch('Max', 1))
81
81
  end
82
82
  end
83
83
  end
@@ -91,11 +91,8 @@ module RuboCop
91
91
 
92
92
  def_node_search :find_contexts, ExampleGroups::ALL.block_pattern
93
93
 
94
- def on_block(node)
95
- describe, = described_constant(node)
96
- return unless describe
97
-
98
- find_nested_contexts(node) do |context|
94
+ def on_top_level_describe(node, _)
95
+ find_nested_contexts(node.parent) do |context|
99
96
  add_offense(context.children.first, :expression)
100
97
  end
101
98
  end
@@ -113,7 +110,7 @@ module RuboCop
113
110
  end
114
111
 
115
112
  def max_nesting
116
- Integer(cop_config.fetch('MaxNesting', 2))
113
+ Integer(cop_config.fetch('MaxNesting', 3))
117
114
  end
118
115
  end
119
116
  end
@@ -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.9.0'.freeze
7
+ STRING = '1.9.1'.freeze
8
8
  end
9
9
  end
10
10
  end
@@ -8,7 +8,6 @@ describe RuboCop::Cop::RSpec::NestedGroups, :config do
8
8
  describe MyClass do
9
9
  context 'when foo' do
10
10
  context 'when bar' do
11
- ^^^^^^^^^^^^^^^^^^ Maximum example group nesting exceeded
12
11
  context 'when baz' do
13
12
  ^^^^^^^^^^^^^^^^^^ Maximum example group nesting exceeded
14
13
  end
@@ -17,7 +16,6 @@ describe RuboCop::Cop::RSpec::NestedGroups, :config do
17
16
 
18
17
  context 'when qux' do
19
18
  context 'when norf' do
20
- ^^^^^^^^^^^^^^^^^^^ Maximum example group nesting exceeded
21
19
  end
22
20
  end
23
21
  end
@@ -35,14 +33,15 @@ describe RuboCop::Cop::RSpec::NestedGroups, :config do
35
33
  RUBY
36
34
  end
37
35
 
38
- context 'when MaxNesting is configured as 3' do
39
- let(:cop_config) { { 'MaxNesting' => '3' } }
36
+ context 'when MaxNesting is configured as 2' do
37
+ let(:cop_config) { { 'MaxNesting' => '2' } }
40
38
 
41
- it 'only flags third level of nesting' do
39
+ it 'flags two levels of nesting' do
42
40
  expect_violation(<<-RUBY)
43
41
  describe MyClass do
44
42
  context 'when foo' do
45
43
  context 'when bar' do
44
+ ^^^^^^^^^^^^^^^^^^ Maximum example group nesting exceeded
46
45
  context 'when baz' do
47
46
  ^^^^^^^^^^^^^^^^^^ Maximum example group nesting exceeded
48
47
  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.9.0
4
+ version: 1.9.1
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: 2016-12-29 00:00:00.000000000 Z
13
+ date: 2017-01-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubocop
@@ -250,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
250
250
  version: '0'
251
251
  requirements: []
252
252
  rubyforge_project:
253
- rubygems_version: 2.5.2
253
+ rubygems_version: 2.5.1
254
254
  signing_key:
255
255
  specification_version: 4
256
256
  summary: Code style checking for RSpec files