summaryrefslogtreecommitdiff
path: root/spec/unit/run_lock_spec.rb
diff options
context:
space:
mode:
authorClaire McQuin <claire@getchef.com>2014-05-19 13:55:18 -0700
committerClaire McQuin <claire@getchef.com>2014-05-22 12:16:36 -0700
commit7d2891419ef04288ddd7bb2322df41cc9bd203dd (patch)
tree354eb64b83b99b4803fb8f7850483e9aca945f20 /spec/unit/run_lock_spec.rb
parent92519eb2cf7ae1b362f22d5710a229c5809a47cc (diff)
downloadchef-7d2891419ef04288ddd7bb2322df41cc9bd203dd.tar.gz
Put cache at HOME/.chef.d if /var/chef can't be accessed.
Diffstat (limited to 'spec/unit/run_lock_spec.rb')
-rw-r--r--spec/unit/run_lock_spec.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/spec/unit/run_lock_spec.rb b/spec/unit/run_lock_spec.rb
index 9738f76650..80140dfcce 100644
--- a/spec/unit/run_lock_spec.rb
+++ b/spec/unit/run_lock_spec.rb
@@ -20,10 +20,12 @@ require 'chef/client'
describe Chef::RunLock do
+ default_cache_path = windows? ? 'C:\chef' : '/var/chef'
default_pid_location = windows? ? 'C:\chef\cache\chef-client-running.pid' : '/var/chef/cache/chef-client-running.pid'
describe "when first created" do
it "locates the lockfile in the file cache path by default" do
+ Chef::Config.stub(:cache_path).and_return(default_cache_path)
run_lock = Chef::RunLock.new(Chef::Config.lockfile)
run_lock.runlock_file.should == default_pid_location
end