summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Cooper <josh@puppetlabs.com>2011-07-27 15:36:20 -0700
committerJacob Helwig <jacob@puppetlabs.com>2011-08-19 13:52:57 -0700
commitf4598ec2fabbab052f8a815290a6aa88c9338e5e (patch)
tree289ab52234bb61d24e40ca248885f5da499b8657
parent68bdc74e5cffa4cce44ccc60ea942484fe64fb62 (diff)
downloadpuppet-f4598ec2fabbab052f8a815290a6aa88c9338e5e.tar.gz
puppet-f4598ec2fabbab052f8a815290a6aa88c9338e5e.tar.xz
puppet-f4598ec2fabbab052f8a815290a6aa88c9338e5e.zip
(#8663) Update the run_mode spec test on Windows to match the code
When running as root, the default conf and var directories on Windows are currently puppet/etc and puppet/var within the windows directory. Updated the spec tests to match what the code does on Windows. Whether or not this is the correct behavior is something that will be addressed in the future. See #8660. Reviewed-by: Jacob Helwig <jacob@puppetlabs.com> (cherry picked from commit f883648d2f6e4c357263c0cf3aa39afd63d852d7)
-rwxr-xr-xspec/unit/util/run_mode_spec.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/unit/util/run_mode_spec.rb b/spec/unit/util/run_mode_spec.rb
index 883ee1206..5d9a3d058 100755
--- a/spec/unit/util/run_mode_spec.rb
+++ b/spec/unit/util/run_mode_spec.rb
@@ -1,14 +1,16 @@
#!/usr/bin/env rspec
require 'spec_helper'
-describe Puppet::Util::RunMode, :fails_on_windows => true do
+describe Puppet::Util::RunMode do
before do
@run_mode = Puppet::Util::RunMode.new('fake')
end
it "should have confdir /etc/puppet when run as root" do
Puppet.features.stubs(:root?).returns(true)
- @run_mode.conf_dir.should == '/etc/puppet'
+ etcdir = Puppet.features.microsoft_windows? ? File.join(Dir::WINDOWS, "puppet", "etc") : '/etc/puppet'
+ # REMIND: issue with windows backslashes
+ @run_mode.conf_dir.should == File.expand_path(etcdir)
end
it "should have confdir ~/.puppet when run as non-root" do
@@ -19,7 +21,9 @@ describe Puppet::Util::RunMode, :fails_on_windows => true do
it "should have vardir /var/lib/puppet when run as root" do
Puppet.features.stubs(:root?).returns(true)
- @run_mode.var_dir.should == '/var/lib/puppet'
+ vardir = Puppet.features.microsoft_windows? ? File.join(Dir::WINDOWS, "puppet", "var") : '/var/lib/puppet'
+ # REMIND: issue with windows backslashes
+ @run_mode.var_dir.should == File.expand_path(vardir)
end
it "should have vardir ~/.puppet/var when run as non-root" do