rubocop-rspec 1.34.0 → 1.34.1

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: b93f9fd4cff11c9b4a47a1bffca8e578bcf0e354320b461d63cdab7d01fad49b
4
- data.tar.gz: 31244d48dd90be566b9f3b18dbe3f7c40112de41ef9fe9dbcbc282e20da2c66e
3
+ metadata.gz: cde39325f1b2c820f9105b689ab70ed80cd0e05bc0255cad156cfd3418e90d33
4
+ data.tar.gz: f538c3972f746964aca96015ea16e5553589601defe597d7069cbbc5e1a20e24
5
5
  SHA512:
6
- metadata.gz: ca99737cdb9ebea08757e8412974d678c846623798efab61a3a8e3e35ece75ccde9c3bcb41a2e800eeefa465ea955ee2683e843b62c0eda3698a0fa9f562fa05
7
- data.tar.gz: ff707c6bd4b46f289beb68127b4b49a214c490914098aaadacf436c0efbf41511ef942cbeb52f50428310788d05fdeaf43be69a6bfe43bf5383fd50d7fe075d9
6
+ metadata.gz: dd46062a2e229f7f9af5404399eb08762cb18eb30649af6d9b3e6ea12e5ee56bbc13a8971ca951626e5239502faa06992ea2c67be74687dbb909e41b1fcfcbe7
7
+ data.tar.gz: 56e6d26667a4c96060fa80cc94795a21db84299272ad0b6ba532bce2e04e3362bbf12c2df53a4ae5db948ef1a1f1441618a201e30eef843aa1463879c0c21809
@@ -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.cbase_type?
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
- # let(:foo_class) do
51
- # Class.new(described_class) do
52
- # def double_that
53
- # some_base_method * 2
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
  #
@@ -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.34.0'
7
+ STRING = '1.34.1'
8
8
  end
9
9
  end
10
10
  end
@@ -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.0
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-23 00:00:00.000000000 Z
13
+ date: 2019-07-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubocop