Skip to content

Commit

Permalink
'subject' method no longer exists in rspec-puppet.
Browse files Browse the repository at this point in the history
Fixes the rspec tests as documented in rodjek/rspec-puppet#235 .
  • Loading branch information
razorsedge committed Feb 7, 2015
1 parent 2fb0218 commit 7d90a6e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion spec/classes/snmp_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
let(:params) {{ :snmp_config => [ 'defVersion 2c', 'defCommunity public' ] }}
it { should contain_file('snmp.conf') }
it 'should contain File[snmp.conf] with contents "defVersion 2c" and "defCommunity public"' do
verify_contents(subject, 'snmp.conf', [
verify_contents(catalogue, 'snmp.conf', [
'defVersion 2c',
'defCommunity public',
])
Expand Down
58 changes: 29 additions & 29 deletions spec/classes/snmp_init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
)}
# TODO add more contents for File[snmpd.conf]
it 'should contain File[snmpd.conf] with expected contents' do
verify_contents(subject, 'snmpd.conf', [
verify_contents(catalogue, 'snmpd.conf', [
'agentaddress udp:127.0.0.1:161,udp6:[::1]:161',
'rocommunity public 127.0.0.1',
'rocommunity6 public ::1',
Expand Down Expand Up @@ -89,7 +89,7 @@
:notify => 'Service[snmpd]'
)}
it 'should contain File[snmpd.sysconfig] with contents "OPTIONS="-LS0-6d -Lf /dev/null -p /var/run/snmpd.pid""' do
verify_contents(subject, 'snmpd.sysconfig', [
verify_contents(catalogue, 'snmpd.sysconfig', [
'OPTIONS="-LS0-6d -Lf /dev/null -p /var/run/snmpd.pid"',
])
end
Expand All @@ -113,7 +113,7 @@
)}
# TODO add more contents for File[snmptrapd.conf]
it 'should contain File[snmptrapd.conf] with correct contents' do
verify_contents(subject, 'snmptrapd.conf', [
verify_contents(catalogue, 'snmptrapd.conf', [
'doNotLogTraps no',
'authCommunity log,execute,net public',
'disableAuthorization no',
Expand All @@ -129,7 +129,7 @@
:notify => 'Service[snmptrapd]'
)}
it 'should contain File[snmptrapd.sysconfig] with contents "OPTIONS="-Lsd -p /var/run/snmptrapd.pid""' do
verify_contents(subject, 'snmptrapd.sysconfig', [
verify_contents(catalogue, 'snmptrapd.sysconfig', [
'OPTIONS="-Lsd -p /var/run/snmptrapd.pid"',
])
end
Expand Down Expand Up @@ -179,7 +179,7 @@
)}
# TODO add more contents for File[snmpd.conf]
it 'should contain File[snmpd.conf] with expected contents' do
verify_contents(subject, 'snmpd.conf', [
verify_contents(catalogue, 'snmpd.conf', [
'agentaddress udp:127.0.0.1:161,udp6:[::1]:161',
'rocommunity public 127.0.0.1',
'rocommunity6 public ::1',
Expand Down Expand Up @@ -207,7 +207,7 @@
:notify => 'Service[snmpd]'
)}
it 'should contain File[snmpd.sysconfig] with contents "SNMPDOPTS=\'-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid\'"' do
verify_contents(subject, 'snmpd.sysconfig', [
verify_contents(catalogue, 'snmpd.sysconfig', [
'SNMPDRUN=yes',
'SNMPDOPTS=\'-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid\'',
])
Expand All @@ -232,15 +232,15 @@
)}
# TODO add more contents for File[snmptrapd.conf]
it 'should contain File[snmptrapd.conf] with correct contents' do
verify_contents(subject, 'snmptrapd.conf', [
verify_contents(catalogue, 'snmptrapd.conf', [
'doNotLogTraps no',
'authCommunity log,execute,net public',
'disableAuthorization no',
])
end
it { should_not contain_file('snmptrapd.sysconfig') }
it 'should contain File[snmpd.sysconfig] with contents "TRAPDOPTS=\'-Lsd -p /var/run/snmptrapd.pid\'"' do
verify_contents(subject, 'snmpd.sysconfig', [
verify_contents(catalogue, 'snmpd.sysconfig', [
'TRAPDRUN=no',
'TRAPDOPTS=\'-Lsd -p /var/run/snmptrapd.pid\'',
])
Expand Down Expand Up @@ -284,7 +284,7 @@
)}
# TODO add more contents for File[snmpd.conf]
it 'should contain File[snmpd.conf] with expected contents' do
verify_contents(subject, 'snmpd.conf', [
verify_contents(catalogue, 'snmpd.conf', [
'agentaddress udp:127.0.0.1:161,udp6:[::1]:161',
'rocommunity public 127.0.0.1',
'rocommunity6 public ::1',
Expand Down Expand Up @@ -312,7 +312,7 @@
:notify => 'Service[snmpd]'
)}
it 'should contain File[snmpd.sysconfig] with contents "SNMPD_LOGLEVEL="d""' do
verify_contents(subject, 'snmpd.sysconfig', [
verify_contents(catalogue, 'snmpd.sysconfig', [
'SNMPD_LOGLEVEL="d"',
])
end
Expand All @@ -336,7 +336,7 @@
)}
# TODO add more contents for File[snmptrapd.conf]
it 'should contain File[snmptrapd.conf] with correct contents' do
verify_contents(subject, 'snmptrapd.conf', [
verify_contents(catalogue, 'snmptrapd.conf', [
'doNotLogTraps no',
'authCommunity log,execute,net public',
'disableAuthorization no',
Expand Down Expand Up @@ -394,7 +394,7 @@
)}
# TODO add more contents for File[snmpd.conf]
it 'should contain File[snmpd.conf] with expected contents' do
verify_contents(subject, 'snmpd.conf', [
verify_contents(catalogue, 'snmpd.conf', [
'agentaddress udp:127.0.0.1:161,udp6:[::1]:161',
'rocommunity public 127.0.0.1',
'rocommunity6 public ::1',
Expand Down Expand Up @@ -432,7 +432,7 @@
)}
# TODO add more contents for File[snmptrapd.conf]
it 'should contain File[snmptrapd.conf] with correct contents' do
verify_contents(subject, 'snmptrapd.conf', [
verify_contents(catalogue, 'snmptrapd.conf', [
'doNotLogTraps no',
'authCommunity log,execute,net public',
'disableAuthorization no',
Expand Down Expand Up @@ -570,7 +570,7 @@
let(:params) {{ :snmpd_options => 'blah' }}
it { should contain_file('snmpd.sysconfig') }
it 'should contain File[snmpd.sysconfig] with contents "OPTIONS=\'blah\'"' do
verify_contents(subject, 'snmpd.sysconfig', [
verify_contents(catalogue, 'snmpd.sysconfig', [
'OPTIONS="blah"',
])
end
Expand All @@ -580,7 +580,7 @@
let(:params) {{ :snmptrapd_options => 'bleh' }}
it { should contain_file('snmptrapd.sysconfig') }
it 'should contain File[snmptrapd.sysconfig] with contents "OPTIONS=\'bleh\'"' do
verify_contents(subject, 'snmptrapd.sysconfig', [
verify_contents(catalogue, 'snmptrapd.sysconfig', [
'OPTIONS="bleh"',
])
end
Expand All @@ -589,7 +589,7 @@
describe 'com2sec => [ SomeString ]' do
let(:params) {{ :com2sec => [ 'SomeString', ] }}
it 'should contain File[snmpd.conf] with contents "com2sec SomeString"' do
verify_contents(subject, 'snmpd.conf', [
verify_contents(catalogue, 'snmpd.conf', [
'com2sec SomeString',
])
end
Expand All @@ -598,7 +598,7 @@
describe 'com2sec6 => [ SomeString ]' do
let(:params) {{ :com2sec6 => [ 'SomeString', ] }}
it 'should contain File[snmpd.conf] with contents "com2sec6 SomeString"' do
verify_contents(subject, 'snmpd.conf', [
verify_contents(catalogue, 'snmpd.conf', [
'com2sec6 SomeString',
])
end
Expand All @@ -607,7 +607,7 @@
describe 'groups => [ SomeString ]' do
let(:params) {{ :groups => [ 'SomeString', ] }}
it 'should contain File[snmpd.conf] with contents "groups SomeString"' do
verify_contents(subject, 'snmpd.conf', [
verify_contents(catalogue, 'snmpd.conf', [
'group SomeString',
])
end
Expand All @@ -616,7 +616,7 @@
describe 'dlmod => [ SomeString ]' do
let(:params) {{ :dlmod => [ 'SomeString', ] }}
it 'should contain File[snmpd.conf] with contents "dlmod SomeString"' do
verify_contents(subject, 'snmpd.conf', [
verify_contents(catalogue, 'snmpd.conf', [
'dlmod SomeString',
])
end
Expand All @@ -625,7 +625,7 @@
describe 'openmanage_enable => true' do
let(:params) {{ :openmanage_enable => true }}
it 'should contain File[snmpd.conf] with contents "smuxpeer .1.3.6.1.4.1.674.10892.1"' do
verify_contents(subject, 'snmpd.conf', [
verify_contents(catalogue, 'snmpd.conf', [
'smuxpeer .1.3.6.1.4.1.674.10892.1',
])
end
Expand All @@ -634,7 +634,7 @@
describe 'agentaddress => [ "1.2.3.4", "8.6.7.5:222" ]' do
let(:params) {{ :agentaddress => ['1.2.3.4','8.6.7.5:222'] }}
it 'should contain File[snmpd.conf] with contents "agentaddress 1.2.3.4,8.6.7.5:222"' do
verify_contents(subject, 'snmpd.conf', [
verify_contents(catalogue, 'snmpd.conf', [
'agentaddress 1.2.3.4,8.6.7.5:222',
])
end
Expand All @@ -643,7 +643,7 @@
describe 'do_not_log_tcpwrappers => "yes"' do
let(:params) {{:do_not_log_tcpwrappers => 'yes'}}
it 'should contain File[snmpd.conf] with contents "dontLogTCPWrappersConnects yes' do
verify_contents(subject, 'snmpd.conf', [
verify_contents(catalogue, 'snmpd.conf', [
'dontLogTCPWrappersConnects yes',
])
end
Expand All @@ -652,7 +652,7 @@
describe 'snmptrapdaddr => [ "5.6.7.8", "2.3.4.5:3333" ]' do
let(:params) {{ :snmptrapdaddr => ['5.6.7.8','2.3.4.5:3333'] }}
it 'should contain File[snmptrapd.conf] with contents "snmpTrapdAddr 5.6.7.8,2.3.4.5:3333"' do
verify_contents(subject, 'snmptrapd.conf', [
verify_contents(catalogue, 'snmptrapd.conf', [
'snmpTrapdAddr 5.6.7.8,2.3.4.5:3333',
])
end
Expand All @@ -661,7 +661,7 @@
describe 'snmpd_config => [ "option 1", "option 2", ]' do
let(:params) {{ :snmpd_config => [ 'option 1', 'option 2', ] }}
it 'should contain File[snmpd.conf] with contents "option1" and "option 2"' do
verify_contents(subject, 'snmpd.conf', [
verify_contents(catalogue, 'snmpd.conf', [
'option 1',
'option 2',
])
Expand All @@ -671,7 +671,7 @@
describe 'snmptrapd_config => [ "option 3", "option 4", ]' do
let(:params) {{ :snmptrapd_config => [ 'option 3', 'option 4', ] }}
it 'should contain File[snmptrapd.conf] with contents "option 3" and "option 4"' do
verify_contents(subject, 'snmptrapd.conf', [
verify_contents(catalogue, 'snmptrapd.conf', [
'option 3',
'option 4',
])
Expand All @@ -696,7 +696,7 @@
it { should contain_service('snmpd').with_ensure('running') }
it { should_not contain_service('snmptrapd') }
it 'should contain File[snmpd.sysconfig] with contents "SNMPDRUN=no" and "TRAPDRUN=yes"' do
verify_contents(subject, 'snmpd.sysconfig', [
verify_contents(catalogue, 'snmpd.sysconfig', [
'SNMPDRUN=no',
'TRAPDRUN=yes',
])
Expand All @@ -707,7 +707,7 @@
let(:params) {{ :snmpd_options => 'blah' }}
it { should contain_file('snmpd.sysconfig') }
it 'should contain File[snmpd.sysconfig] with contents "SNMPDOPTS=\'blah\'"' do
verify_contents(subject, 'snmpd.sysconfig', [
verify_contents(catalogue, 'snmpd.sysconfig', [
'SNMPDOPTS=\'blah\'',
])
end
Expand All @@ -717,7 +717,7 @@
let(:params) {{ :snmptrapd_options => 'bleh' }}
it { should contain_file('snmpd.sysconfig') }
it 'should contain File[snmpd.sysconfig] with contents "TRAPDOPTS=\'bleh\'"' do
verify_contents(subject, 'snmpd.sysconfig', [
verify_contents(catalogue, 'snmpd.sysconfig', [
'TRAPDOPTS=\'bleh\'',
])
end
Expand Down Expand Up @@ -758,7 +758,7 @@
let(:params) {{ :snmpd_options => 'blah' }}
it { should contain_file('snmpd.sysconfig') }
it 'should contain File[snmpd.sysconfig] with contents "SNMPD_LOGLEVEL="blah""' do
verify_contents(subject, 'snmpd.sysconfig', [
verify_contents(catalogue, 'snmpd.sysconfig', [
'SNMPD_LOGLEVEL="blah"',
])
end
Expand Down

0 comments on commit 7d90a6e

Please sign in to comment.