]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
Fix for rspec-system-puppet 0.3.x
authorKen Barber <ken@bob.sh>
Thu, 11 Apr 2013 13:53:49 +0000 (14:53 +0100)
committerKen Barber <ken@bob.sh>
Thu, 11 Apr 2013 13:53:49 +0000 (14:53 +0100)
Signed-off-by: Ken Barber <ken@bob.sh>
spec/spec_helper_system.rb
spec/system/basic_spec.rb

index 47bf9e7a768c5486bae7df8352d900166094bc2c..0d1819c6124246c6d0e58e71b0a35d4b9908f9be 100644 (file)
@@ -13,9 +13,9 @@ RSpec.configure do |c|
     include RSpecSystemPuppet::Helpers
 
     # Install puppet
-    system_puppet_install
+    puppet_install
 
     # Copy this module into the module path of the test node
-    system_puppet_module_from_path(:source => proj_root, :module_name => 'firewall')
+    puppet_module_install(:source => proj_root, :module_name => 'firewall')
   end
 end
index a41241732616ae8cbb3f9f7df7deff712882f764..71309c4130d898cc61f9c44f868b865b908c9077 100644 (file)
@@ -7,9 +7,9 @@ describe "basic tests:" do
   # It checks that the flush command returns with no errors.
   def iptables_flush_all_tables
     ['filter', 'nat', 'mangle', 'raw'].each do |t|
-      system_run("iptables -t #{t} -F") do |s, o, e|
-        s.exitstatus.should == 0
-        e.should == ''
+      system_run("iptables -t #{t} -F") do |r|
+        r[:exit_code].should == 0
+        r[:stderr].should == ''
       end
     end
   end
@@ -17,10 +17,10 @@ describe "basic tests:" do
   context 'prelim:' do
     it 'make sure we have copied the module across' do
       # No point diagnosing any more if the module wasn't copied properly
-      system_run("ls /etc/puppet/modules/firewall") do |s, o, e|
-        s.exitstatus.should == 0
-        o.should =~ /Modulefile/
-        e.should == ''
+      system_run("ls /etc/puppet/modules/firewall") do |r|
+        r[:exit_code].should == 0
+        r[:stdout].should =~ /Modulefile/
+        r[:stderr].should == ''
       end
     end
   end
@@ -29,20 +29,20 @@ describe "basic tests:" do
     it 'make sure it returns no errors when executed on a clean machine' do
       # Except for the absence of iptables, it should run perfectly usually
       # most hosts have iptables at least.
-      system_run('puppet resource firewall') do |s, o, e|
-        s.exitstatus.should == 0
+      puppet_resource('firewall') do |r|
+        r[:exit_code].should == 0
         # don't check stdout, some boxes come with rules, that is normal
-        e.should == ''
+        r[:stderr].should == ''
       end
     end
 
     it 'flush iptables and make sure it returns nothing afterwards' do
       iptables_flush_all_tables
       # No rules, means no output thanks. And no errors as well.
-      system_run('puppet resource firewall') do |s, o, e|
-        s.exitstatus.should == 0
-        e.should == ''
-        o.should == "\n"
+      puppet_resource('firewall') do |r|
+        r[:exit_code].should == 0
+        r[:stderr].should == ''
+        r[:stdout].should == "\n"
       end
     end
   end