rubocop-rspec 1.34.0 → 1.34.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cde39325f1b2c820f9105b689ab70ed80cd0e05bc0255cad156cfd3418e90d33
|
4
|
+
data.tar.gz: f538c3972f746964aca96015ea16e5553589601defe597d7069cbbc5e1a20e24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd46062a2e229f7f9af5404399eb08762cb18eb30649af6d9b3e6ea12e5ee56bbc13a8971ca951626e5239502faa06992ea2c67be74687dbb909e41b1fcfcbe7
|
7
|
+
data.tar.gz: 56e6d26667a4c96060fa80cc94795a21db84299272ad0b6ba532bce2e04e3362bbf12c2df53a4ae5db948ef1a1f1441618a201e30eef843aa1463879c0c21809
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
## Master (Unreleased)
|
4
4
|
|
5
|
+
## 1.34.1 (2019-07-31)
|
6
|
+
|
7
|
+
* Fix `RSpec/DescribedClass`'s error when a local variable is part of the namespace. ([@pirj][])
|
8
|
+
|
5
9
|
## 1.34.0 (2019-07-23)
|
6
10
|
|
7
11
|
* Remove `AggregateFailuresByDefault` config option of `RSpec/MultipleExpectations`. ([@pirj][])
|
@@ -166,10 +166,10 @@ module RuboCop
|
|
166
166
|
# rubocop:enable InternalAffairs/NodeDestructuring
|
167
167
|
if !namespace
|
168
168
|
[name]
|
169
|
-
elsif namespace.
|
170
|
-
[nil, name]
|
171
|
-
else
|
169
|
+
elsif namespace.const_type?
|
172
170
|
[*const_name(namespace), name]
|
171
|
+
elsif namespace.lvar_type? || namespace.cbase_type?
|
172
|
+
[nil, name]
|
173
173
|
end
|
174
174
|
end
|
175
175
|
|
@@ -47,10 +47,12 @@ module RuboCop
|
|
47
47
|
# end
|
48
48
|
#
|
49
49
|
# # good - anonymous class, no constant needs to be defined
|
50
|
-
#
|
51
|
-
#
|
52
|
-
#
|
53
|
-
#
|
50
|
+
# describe SomeClass do
|
51
|
+
# let(:foo_class) do
|
52
|
+
# Class.new(described_class) do
|
53
|
+
# def double_that
|
54
|
+
# some_base_method * 2
|
55
|
+
# end
|
54
56
|
# end
|
55
57
|
# end
|
56
58
|
#
|
@@ -255,6 +255,18 @@ RSpec.describe RuboCop::Cop::RSpec::DescribedClass, :config do
|
|
255
255
|
end
|
256
256
|
RUBY
|
257
257
|
end
|
258
|
+
|
259
|
+
it 'ignores if a local variable is part of the namespace' do
|
260
|
+
expect_no_offenses(<<-RUBY)
|
261
|
+
describe Broken do
|
262
|
+
[Foo, Bar].each do |klass|
|
263
|
+
describe klass::Baz.name do
|
264
|
+
it { }
|
265
|
+
end
|
266
|
+
end
|
267
|
+
end
|
268
|
+
RUBY
|
269
|
+
end
|
258
270
|
end
|
259
271
|
|
260
272
|
context 'when EnforcedStyle is :explicit' do
|
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.34.
|
4
|
+
version: 1.34.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: 2019-07-
|
13
|
+
date: 2019-07-31 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rubocop
|