From 683bda3e3e644c3c98ef5b3c224013053b1ea6fa Mon Sep 17 00:00:00 2001 From: Ken Barber Date: Tue, 22 Oct 2013 13:22:05 +0100 Subject: [PATCH] Fix idempotency tests Signed-off-by: Ken Barber --- spec/system/basic_spec.rb | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/spec/system/basic_spec.rb b/spec/system/basic_spec.rb index 31348bc..0574219 100644 --- a/spec/system/basic_spec.rb +++ b/spec/system/basic_spec.rb @@ -4,16 +4,16 @@ describe 'basic tests:' do it 'make sure we have copied the module across' do # No point diagnosing any more if the module wasn't copied properly shell("ls /etc/puppet/modules/puppetdb") do |r| - r[:exit_code].should == 0 - r[:stdout].should =~ /Modulefile/ - r[:stderr].should == '' + r.exit_code.should == 0 + r.stdout.should =~ /Modulefile/ + r.stderr.should == '' end end it 'make sure a puppet agent has ran' do puppet_agent do |r| - r[:stderr].should == '' - r[:exit_code].should == 0 + r.stderr.should == '' + r.exit_code.should == 0 end end @@ -32,13 +32,9 @@ class { 'puppetdb::master::config': } shell('puppet module install puppetlabs/inifile --version "1.x"') puppet_apply(pp) do |r| - r[:exit_code].should_not eq(1) - end - end - - it 'should be idempotent' do - puppet_apply(:code => pp, :debug => true) do |r| - r[:exit_code].should == 0 + r.exit_code.should_not eq(1) + r.refresh + r.exit_code.should == 0 end end end @@ -55,7 +51,9 @@ class { 'puppetdb::master::config': it 'should add the puppetdb report processor to puppet.conf' do puppet_apply(pp) do |r| - r[:exit_code].should_not eq(1) + r.exit_code.should_not eq(1) + r.refresh + r.exit_code.should == 0 end shell("cat /etc/puppet/puppet.conf") do |r|