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 <[email protected]> Signed-off-by: Jacob Helwig <[email protected]> --- spec/unit/configurer_spec.rb | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/unit/configurer_spec.rb b/spec/unit/configurer_spec.rb index f8a4869..020d185 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 -- 1.7.5.4 -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
