Skip to content

Commit 9118232

Browse files
committed
(RUBOCOP) Unsafe autocorrections
1 parent b22210f commit 9118232

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

spec/integration/resource_api_spec.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,7 @@ def get(_context)
239239
end
240240

241241
before do
242-
allow(catalog).to receive(:resource).and_return nil
243-
allow(catalog).to receive(:alias).and_return nil
244-
allow(catalog).to receive(:host_config?).and_return true
242+
allow(catalog).to receive_messages(resource: nil, alias: nil, host_config?: true)
245243
end
246244

247245
it('flushes') { expect { instance.flush }.not_to raise_exception }

spec/puppet/resource_api/property_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,7 @@
203203
allow(resource).to receive(:rsapi_canonicalized_target_state)
204204
allow(resource).to receive(:rsapi_current_state)
205205
allow(resource).to receive(:rsapi_title)
206-
allow(referrable_type_custom_insync).to receive(:context).and_return(context)
207-
allow(referrable_type_custom_insync).to receive(:my_provider).and_return(test_provider_with_insync)
206+
allow(referrable_type_custom_insync).to receive_messages(context: context, my_provider: test_provider_with_insync)
208207
end
209208

210209
context 'when the property is not rsapi_custom_insync_trigger' do

spec/puppet/resource_api/simple_provider_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,7 @@ def delete(context, _name); end
445445
before do
446446
allow(context).to receive(:updating).with('title').and_yield
447447
allow(type_def).to receive(:feature?).with('simple_get_filter')
448-
allow(type_def).to receive(:ensurable?).and_return(false)
449-
allow(type_def).to receive(:namevars).and_return([:name])
448+
allow(type_def).to receive_messages(ensurable?: false, namevars: [:name])
450449
end
451450

452451
it { expect { provider.set(context, changes) }.to raise_error(/SimpleProvider cannot be used with a Type that is not ensurable/) }

spec/puppet/resource_api/transport/wrapper_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ class SomethingSomethingDarkside; end
6464
let(:transport) { instance_double(Puppet::Transport::TestDevice, 'transport') }
6565

6666
it 'returns the facts provided by the transport' do
67-
allow(Puppet::ResourceApi::Transport).to receive(:connect).and_return(transport)
68-
allow(Puppet::ResourceApi::Transport).to receive(:list).and_return(schema: :dummy)
67+
allow(Puppet::ResourceApi::Transport).to receive_messages(connect: transport, list: { schema: :dummy })
6968
allow(Puppet::ResourceApi::PuppetContext).to receive(:new).and_return(context)
7069
allow(transport).to receive(:facts).with(context).and_return(facts)
7170

0 commit comments

Comments
 (0)