diff options
| -rw-r--r-- | lib/puppet/util.rb | 2 | ||||
| -rwxr-xr-x | test/ral/manager/provider.rb | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb index 8e07a27a1..777afab5f 100644 --- a/lib/puppet/util.rb +++ b/lib/puppet/util.rb @@ -221,7 +221,7 @@ module Util def binary(bin) if bin =~ /^\// if FileTest.exists? bin - return true + return bin else return nil end diff --git a/test/ral/manager/provider.rb b/test/ral/manager/provider.rb index cafb84deb..0394634af 100755 --- a/test/ral/manager/provider.rb +++ b/test/ral/manager/provider.rb @@ -56,7 +56,7 @@ class TestTypeProviders < Test::Unit::TestCase cleanup { Puppet::Type.rmtype(:commands) } echo = %x{which echo}.chomp - {:echo => echo, :echo => "echo", :missing => "nosuchcommand", :missing => "/path/to/nosuchcommand"}.each do |name, command| + {:echo_plain => "echo", :echo_with_path => echo, :missing_unqualified => "nosuchcommand", :missing_qualified => "/path/to/nosuchcommand"}.each do |name, command| # Define a provider with mandatory commands provider = type.provide(:testing) {} @@ -64,12 +64,12 @@ class TestTypeProviders < Test::Unit::TestCase provider.commands(name => command) end - case name - when :echo: - assert_equal(echo, provider.command(:echo), "Did not get correct path for echo") + case name.to_s + when /echo/ + assert_equal(echo, provider.command(name), "Did not get correct path for echo") assert(provider.suitable?, "Provider was not considered suitable with 'echo'") - when :missing: - assert_nil(provider.command(:missing), "Somehow got a response for missing commands") + when /missing/ + assert_nil(provider.command(name), "Somehow got a response for missing commands") assert(! provider.suitable?, "Provider was considered suitable with missing command") else raise "Invalid name %s" % name |
