diff options
Diffstat (limited to 'spec/integration/defaults.rb')
-rwxr-xr-x | spec/integration/defaults.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/integration/defaults.rb b/spec/integration/defaults.rb index b3f3a7066..46b5fd64e 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 @@ -83,4 +84,12 @@ describe "Puppet defaults" do Puppet.settings.element(setting).should be_instance_of(Puppet::Util::Settings::CElement) end 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 |