Skip to content

Commit 6c84643

Browse files
(PA-7815) Rubocop changes for PDK template 3.5.1
1 parent 4e77c44 commit 6c84643

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

spec/spec_helper_acceptance.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def run_puppet_install_helper
5252

5353
agent_sha = ENV['BEAKER_PUPPET_AGENT_SHA'] || ENV['PUPPET_AGENT_SHA']
5454
if agent_sha.nil? || agent_sha.empty?
55-
install_puppet_agent_on(hosts, options.merge(version: version))
55+
install_puppet_agent_on(hosts, options.merge(version:))
5656
else
5757
# If we have a development sha, assume we're testing internally
5858
dev_builds_url = ENV['DEV_BUILDS_URL'] || 'http://builds.delivery.puppetlabs.net'

spec/unit/type/host_spec.rb

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

55
describe Puppet::Type.type(:host) do
66
let(:provider) { FakeHostProvider.new }
7-
let(:resource) { instance_double('Puppet::Type::Host', provider: provider) }
7+
let(:resource) { instance_double('Puppet::Type::Host', provider:) }
88

99
it 'has :name be its namevar' do
1010
expect(described_class.key_attributes).to eq([:name])
@@ -257,7 +257,7 @@
257257
'::0:a:b:c:d:e:f', # syntactically correct, but bad form (::0:... could be combined)
258258
'a:b:c:d:e:f:0::'].each do |ip|
259259
it "accepts #{ip.inspect} as an IPv6 address" do
260-
expect { described_class.new(name: 'foo', ip: ip) }.not_to raise_error
260+
expect { described_class.new(name: 'foo', ip:) }.not_to raise_error
261261
end
262262
end
263263

@@ -588,7 +588,7 @@
588588
'::3333:4444:5555:6666:7777:8888:',
589589
'::2222:3333:4444:5555:6666:7777:8888:'].each do |ip|
590590
it "rejects #{ip.inspect} as an IPv6 address" do
591-
expect { described_class.new(name: 'foo', ip: ip) }.to raise_error(Puppet::ResourceError, %r{Parameter ip failed})
591+
expect { described_class.new(name: 'foo', ip:) }.to raise_error(Puppet::ResourceError, %r{Parameter ip failed})
592592
end
593593
end
594594

@@ -623,42 +623,42 @@
623623

624624
describe 'when syncing' do
625625
it 'sends the first value to the provider for ip property' do
626-
ip = described_class.attrclass(:ip).new(resource: resource, should: ['192.168.0.1', '192.168.0.2'])
626+
ip = described_class.attrclass(:ip).new(resource:, should: ['192.168.0.1', '192.168.0.2'])
627627
ip.sync
628628

629629
expect(provider.ip).to eq('192.168.0.1')
630630
end
631631

632632
it 'sends the first value to the provider for comment property' do
633-
comment = described_class.attrclass(:comment).new(resource: resource, should: ['Bazinga', 'Notme'])
633+
comment = described_class.attrclass(:comment).new(resource:, should: ['Bazinga', 'Notme'])
634634
comment.sync
635635

636636
expect(provider.comment).to eq('Bazinga')
637637
end
638638

639639
it 'sends the joined array to the provider for host_alias' do
640-
host_aliases = described_class.attrclass(:host_aliases).new(resource: resource, should: ['foo', 'bar'])
640+
host_aliases = described_class.attrclass(:host_aliases).new(resource:, should: ['foo', 'bar'])
641641
host_aliases.sync
642642

643643
expect(provider.host_aliases).to eq('foo bar')
644644
end
645645

646646
it 'alsoes use the specified delimiter for joining' do
647-
host_aliases = described_class.attrclass(:host_aliases).new(resource: resource, should: ['foo', 'bar'])
647+
host_aliases = described_class.attrclass(:host_aliases).new(resource:, should: ['foo', 'bar'])
648648
allow(host_aliases).to receive(:delimiter).and_return "\t"
649649
host_aliases.sync
650650

651651
expect(provider.host_aliases).to eq("foo\tbar")
652652
end
653653

654654
it 'cares about the order of host_aliases' do
655-
host_aliases = described_class.attrclass(:host_aliases).new(resource: resource, should: ['foo', 'bar'])
655+
host_aliases = described_class.attrclass(:host_aliases).new(resource:, should: ['foo', 'bar'])
656656
expect(host_aliases.insync?(['foo', 'bar'])).to eq(true)
657657
expect(host_aliases.insync?(['bar', 'foo'])).to eq(false)
658658
end
659659

660660
it 'does not consider aliases to be in sync if should is a subset of current' do
661-
host_aliases = described_class.attrclass(:host_aliases).new(resource: resource, should: ['foo', 'bar'])
661+
host_aliases = described_class.attrclass(:host_aliases).new(resource:, should: ['foo', 'bar'])
662662
expect(host_aliases.insync?(['foo', 'bar', 'anotherone'])).to eq(false)
663663
end
664664
end

0 commit comments

Comments
 (0)