Skip to content

Commit 912fe96

Browse files
committed
rubocop: autofix
1 parent 980224d commit 912fe96

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

spec/classes/snmp_init_spec.rb

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,7 @@
165165
describe 'ensure => badvalue' do
166166
let(:params) { { ensure: 'badvalue' } }
167167

168-
it 'fails' do
169-
expect do
170-
is_expected.to raise_error(Puppet::Error, %r{ensure parameter must be present or absent})
171-
end
172-
end
168+
it { is_expected.to compile.and_raise_error(%r{expects a match for}) }
173169
end
174170

175171
describe 'autoupgrade => true' do
@@ -189,21 +185,13 @@
189185
describe 'autoupgrade => badvalue' do
190186
let(:params) { { autoupgrade: 'badvalue' } }
191187

192-
it 'fails' do
193-
expect do
194-
is_expected.to raise_error(Puppet::Error, %r{"badvalue" is not a boolean.})
195-
end
196-
end
188+
it { is_expected.to compile.and_raise_error(%r{expects a Boolean value, got String}) }
197189
end
198190

199191
describe 'service_ensure => badvalue' do
200192
let(:params) { { service_ensure: 'badvalue' } }
201193

202-
it 'fails' do
203-
expect do
204-
is_expected.to raise_error(Puppet::Error, %r{service_ensure parameter must be running or stopped})
205-
end
206-
end
194+
it { is_expected.to compile.and_raise_error(%r{expects a match for Stdlib::Ensure::Service}) }
207195
end
208196

209197
describe 'service_config_perms => "0123"' do

0 commit comments

Comments
 (0)