Skip to content

Commit 3faaca1

Browse files
committed
Add specs to verify that false types raise errors on networks and
sudoers parameters.
1 parent 38278b8 commit 3faaca1

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

spec/classes/init_spec.rb

+22
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,28 @@
453453
}
454454
end
455455

456+
context 'networks with invalid type' do
457+
let(:facts) { { :osfamily => 'RedHat' } }
458+
let(:params) { { :networks => ['not','a','string'] } }
459+
460+
it do
461+
expect {
462+
should contain_class('nsswitch')
463+
}.to raise_error(Puppet::Error,/\["not", "a", "string"\] is not a string/)
464+
end
465+
end
466+
467+
context 'sudoers with invalid type' do
468+
let(:facts) { { :osfamily => 'RedHat' } }
469+
let(:params) { { :sudoers => ['not','a','string'] } }
470+
471+
it do
472+
expect {
473+
should contain_class('nsswitch')
474+
}.to raise_error(Puppet::Error,/\["not", "a", "string"\] is not a string/)
475+
end
476+
end
477+
456478
context 'with config_file set' do
457479
let :params do
458480
{ :config_file => '/path/to/nsswitch.conf' }

0 commit comments

Comments
 (0)