Skip to content

Commit bae7766

Browse files
committed
Unsafe BeEq autocorrection
1 parent 4d27abc commit bae7766

File tree

6 files changed

+12
-22
lines changed

6 files changed

+12
-22
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,6 @@ Lint/EmptyClass:
2424
- 'spec/puppet/resource_api/transport_spec.rb'
2525
- 'spec/puppet/resource_api_spec.rb'
2626

27-
# Offense count: 12
28-
# This cop supports unsafe autocorrection (--autocorrect-all).
29-
RSpec/BeEq:
30-
Exclude:
31-
- 'spec/puppet/resource_api/parameter_spec.rb'
32-
- 'spec/puppet/resource_api/property_spec.rb'
33-
- 'spec/puppet/resource_api/read_only_parameter_spec.rb'
34-
- 'spec/puppet/resource_api/transport/wrapper_spec.rb'
35-
- 'spec/puppet/resource_api/value_creator_spec.rb'
36-
3727
# Offense count: 25
3828
# Configuration parameters: IgnoredMetadata.
3929
RSpec/DescribeClass:

spec/puppet/resource_api/parameter_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
expect { parameter.value = 'value' }.to raise_error Exception, 'error'
2727

28-
expect(parameter.value).to eq nil
28+
expect(parameter.value).to be_nil
2929
end
3030
end
3131

@@ -51,8 +51,8 @@
5151
let(:munged_value) { true }
5252
let(:data_type) { Puppet::Pops::Types::PBooleanType.new }
5353

54-
it { expect(parameter.rs_value).to eq true }
55-
it { expect(parameter.value).to eq true }
54+
it { expect(parameter.rs_value).to be true }
55+
it { expect(parameter.value).to be true }
5656
end
5757
end
5858
end

spec/puppet/resource_api/property_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
describe '#insync?' do
5050
it 'compares using symbols' do
51-
expect(ensure_property.insync?(:present)).to eq(true)
51+
expect(ensure_property.insync?(:present)).to be(true)
5252
end
5353
end
5454

@@ -153,7 +153,7 @@
153153
end
154154

155155
it 'compares using symbols' do
156-
expect(ensure_property.insync?(:present)).to eq(true)
156+
expect(ensure_property.insync?(:present)).to be(true)
157157
end
158158
end
159159
end
@@ -285,7 +285,7 @@
285285

286286
expect { property.should = 'value' }.to raise_error Exception, 'error'
287287

288-
expect(property.should).to eq nil
288+
expect(property.should).to be_nil
289289
end
290290
end
291291

@@ -313,7 +313,7 @@
313313
let(:data_type) { Puppet::Pops::Types::PBooleanType.new }
314314

315315
it { expect(property.should).to eq :true } # rubocop:disable Lint/BooleanSymbol
316-
it { expect(property.rs_value).to eq true }
316+
it { expect(property.rs_value).to be true }
317317
it { expect(property.value).to eq :true } # rubocop:disable Lint/BooleanSymbol
318318
end
319319
end

spec/puppet/resource_api/read_only_parameter_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
end
3030

3131
context 'when value is not set' do
32-
it { expect(read_only_parameter.rs_value).to eq nil }
33-
it { expect(read_only_parameter.value).to eq nil }
32+
it { expect(read_only_parameter.rs_value).to be_nil }
33+
it { expect(read_only_parameter.value).to be_nil }
3434
end
3535

3636
context 'when value is already set' do

spec/puppet/resource_api/transport/wrapper_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class SomethingSomethingDarkside; end
110110
context 'when the transport does not support the function' do
111111
context 'when using respond_to?' do
112112
it 'returns false' do
113-
expect(instance.respond_to?(:wibble)).to eq(false)
113+
expect(instance.respond_to?(:wibble)).to be(false)
114114
end
115115
end
116116

@@ -128,7 +128,7 @@ class SomethingSomethingDarkside; end
128128

129129
context 'when using respond_to?' do
130130
it 'returns true' do
131-
expect(instance.respond_to?(:close)).to eq(true)
131+
expect(instance.respond_to?(:close)).to be(true)
132132
end
133133
end
134134

spec/puppet/resource_api/value_creator_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
let(:param_or_property) { :newparam }
120120

121121
it 'attribute_class has no #call_provider method' do
122-
expect(attribute_class.method_defined?(:call_provider)).to eq(false)
122+
expect(attribute_class.method_defined?(:call_provider)).to be(false)
123123
end
124124

125125
context 'when behaviour is set to :namevar' do

0 commit comments

Comments
 (0)