summaryrefslogtreecommitdiff
path: root/spec/unit/role_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/role_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/role_spec.rb')
-rw-r--r--spec/unit/role_spec.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/spec/unit/role_spec.rb b/spec/unit/role_spec.rb
index f36b7f13bd..7410b3a0c6 100644
--- a/spec/unit/role_spec.rb
+++ b/spec/unit/role_spec.rb
@@ -250,6 +250,11 @@ description "like Aliens, but furry"
EOR
describe "when loading from disk" do
+ before do
+ default_cache_path = windows? ? 'C:\chef' : '/var/chef'
+ Chef::Config.stub(:cache_path).and_return(default_cache_path)
+ end
+
it "should return a Chef::Role object from JSON" do
File.should_receive(:exists?).with(File.join(Chef::Config[:role_path], 'lolcat.json')).exactly(1).times.and_return(true)
IO.should_receive(:read).with(File.join(Chef::Config[:role_path], 'lolcat.json')).and_return('{"name": "ceiling_cat", "json_class": "Chef::Role" }')
@@ -325,4 +330,3 @@ EOR
end
end
-