summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-03-22 22:00:41 -0500
committerJames Turnbull <james@lovedthanlost.net>2009-03-24 08:15:33 +1100
commitaa00bdedefcf4dce9c55968e33123a73b78fb6d6 (patch)
tree9ba8aee18d1aec93124c36c8d5ee9745da11db2b /spec
parent39deaf373c46c20d14a04391ad4b7c70ad43e266 (diff)
Fixing #1631 - adding /sbin and /usr/sbin to PATH
This is a trivial fix but seems to crop up more often than it should. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec')
-rwxr-xr-xspec/integration/defaults.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/integration/defaults.rb b/spec/integration/defaults.rb
index 54b673a1a..0b2b756bf 100755
--- a/spec/integration/defaults.rb
+++ b/spec/integration/defaults.rb
@@ -5,6 +5,7 @@ require File.dirname(__FILE__) + '/../spec_helper'
require 'puppet/defaults'
describe "Puppet defaults" do
+ include Puppet::Util::Execution
after { Puppet.settings.clear }
describe "when setting the :factpath" do
@@ -44,4 +45,12 @@ describe "Puppet defaults" do
it "should default to yaml as the catalog format" do
Puppet.settings[:catalog_format].should == "yaml"
end
+
+ it "should add /usr/sbin and /sbin to the path if they're not there" do
+ withenv("PATH" => "/usr/bin:/usr/local/bin") do
+ Puppet.settings[:path] = "none" # this causes it to ignore the setting
+ ENV["PATH"].split(File::PATH_SEPARATOR).should be_include("/usr/sbin")
+ ENV["PATH"].split(File::PATH_SEPARATOR).should be_include("/sbin")
+ end
+ end
end