From 902c4147a2100c1f71d8493c526ae5275bab4cdc Mon Sep 17 00:00:00 2001 From: Jacob Helwig Date: Tue, 28 Jun 2011 19:19:10 -0700 Subject: Update configurer_spec.rb to work with Ruby 1.8.5 Ruby 1.8.5 doesn't have start_with? on String, so instead of checking the log message using start_with? we check using a regex. Reviewed-by: Nick Lewis --- spec/unit/configurer_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/unit/configurer_spec.rb b/spec/unit/configurer_spec.rb index f8a486928..020d1850f 100755 --- a/spec/unit/configurer_spec.rb +++ b/spec/unit/configurer_spec.rb @@ -244,7 +244,7 @@ describe Puppet::Configurer do Puppet.settings[:prerun_command] = "/my/command" Puppet::Util.expects(:execute).with(["/my/command"]).raises(Puppet::ExecutionFailure, "Failed") - report.expects(:<<).with { |log| log.message.start_with?("Could not run command from prerun_command") } + report.expects(:<<).with { |log| log.message =~ /^Could not run command from prerun_command/ } @agent.run.should be_nil end @@ -267,7 +267,7 @@ describe Puppet::Configurer do Puppet.settings[:postrun_command] = "/my/command" Puppet::Util.expects(:execute).with(["/my/command"]).raises(Puppet::ExecutionFailure, "Failed") - report.expects(:<<).with { |log| log.message.start_with?("Could not run command from postrun_command") } + report.expects(:<<).with { |log| log.message =~ /^Could not run command from postrun_command/ } @agent.run.should be_nil end -- cgit