summaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/resource/chocolatey_config_spec.rb11
-rw-r--r--spec/unit/resource/chocolatey_source_spec.rb11
2 files changed, 22 insertions, 0 deletions
diff --git a/spec/unit/resource/chocolatey_config_spec.rb b/spec/unit/resource/chocolatey_config_spec.rb
index 5f4d9c78de..e92280307b 100644
--- a/spec/unit/resource/chocolatey_config_spec.rb
+++ b/spec/unit/resource/chocolatey_config_spec.rb
@@ -38,6 +38,17 @@ describe Chef::Resource::ChocolateyConfig do
CONFIG
end
+ # we save off the ENV and set ALLUSERSPROFILE so these specs will work on *nix and non-C drive Windows installs
+ before(:each) do
+ @original_env = ENV.to_hash
+ ENV['ALLUSERSPROFILE'] = 'C:\ProgramData'
+ end
+
+ after(:each) do
+ ENV.clear
+ ENV.update(@original_env)
+ end
+
it "has a resource name of :chocolatey_config" do
expect(resource.resource_name).to eql(:chocolatey_config)
end
diff --git a/spec/unit/resource/chocolatey_source_spec.rb b/spec/unit/resource/chocolatey_source_spec.rb
index ee8d098b0b..ee179f931b 100644
--- a/spec/unit/resource/chocolatey_source_spec.rb
+++ b/spec/unit/resource/chocolatey_source_spec.rb
@@ -38,6 +38,17 @@ describe Chef::Resource::ChocolateySource do
CONFIG
end
+ # we save off the ENV and set ALLUSERSPROFILE so these specs will work on *nix and non-C drive Windows installs
+ before(:each) do
+ @original_env = ENV.to_hash
+ ENV['ALLUSERSPROFILE'] = 'C:\ProgramData'
+ end
+
+ after(:each) do
+ ENV.clear
+ ENV.update(@original_env)
+ end
+
it "has a resource name of :chocolatey_source" do
expect(resource.resource_name).to eql(:chocolatey_source)
end