summaryrefslogtreecommitdiff
path: root/spec/unit/provider
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2020-08-12 20:12:58 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2020-08-17 15:02:17 -0700
commite538037d00fe0a5eb71444383985969e308684b7 (patch)
tree10b9372015e5c626d2eade751ebf5289b7a80211 /spec/unit/provider
parentfb10fe7123da931438fe8ae255ed9a6c1168cd4d (diff)
downloadchef-e538037d00fe0a5eb71444383985969e308684b7.tar.gz
Add unit and integration testing back to omnibus testers
It is slow but it does catch real bugs Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/unit/provider')
-rw-r--r--spec/unit/provider/package/powershell_spec.rb2
-rw-r--r--spec/unit/provider/package/rubygems_spec.rb5
2 files changed, 5 insertions, 2 deletions
diff --git a/spec/unit/provider/package/powershell_spec.rb b/spec/unit/provider/package/powershell_spec.rb
index 482b19c218..256901c928 100644
--- a/spec/unit/provider/package/powershell_spec.rb
+++ b/spec/unit/provider/package/powershell_spec.rb
@@ -19,7 +19,7 @@
require "spec_helper"
require "chef/mixin/powershell_out"
-describe Chef::Provider::Package::Powershell, :windows_only do
+describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do
include Chef::Mixin::PowershellOut
let(:timeout) { 900 }
let(:source) { nil }
diff --git a/spec/unit/provider/package/rubygems_spec.rb b/spec/unit/provider/package/rubygems_spec.rb
index d2b2a66027..6f31c231ce 100644
--- a/spec/unit/provider/package/rubygems_spec.rb
+++ b/spec/unit/provider/package/rubygems_spec.rb
@@ -387,8 +387,9 @@ describe Chef::Provider::Package::Rubygems do
before(:each) do
# We choose detect omnibus via RbConfig::CONFIG['bindir'] in Chef::Provider::Package::Rubygems.new
allow(RbConfig::CONFIG).to receive(:[]).with("bindir").and_return(bindir)
- # Rubygems uses this interally
+ # Rubygems uses these two interally
allow(RbConfig::CONFIG).to receive(:[]).with("arch").and_call_original
+ allow(RbConfig::CONFIG).to receive(:[]).with("ruby_install_name").and_call_original
allow(File).to receive(:executable?).and_return false
allow(File).to receive(:executable?).with("#{bindir}/gem").and_return true
# XXX: we can't stub the provider object directly here because referencing it will create it and that
@@ -467,6 +468,7 @@ describe Chef::Provider::Package::Rubygems do
it "searches for a gem binary when running on Omnibus on Unix" do
platform_mock :unix do
allow(ENV).to receive(:[]).with("PATH").and_return("/usr/bin:/usr/sbin:/opt/chef/embedded/bin")
+ allow(ENV).to receive(:[]).with("PATHEXT").and_return(nil)
allow(File).to receive(:executable?).with("/usr/bin/gem").and_return(false)
allow(File).to receive(:executable?).with("/usr/sbin/gem").and_return(true)
allow(File).to receive(:executable?).with("/opt/chef/embedded/bin/gem").and_return(true) # should not get here
@@ -480,6 +482,7 @@ describe Chef::Provider::Package::Rubygems do
it "searches for a gem binary when running on Omnibus on Windows" do
platform_mock :windows do
allow(ENV).to receive(:[]).with("PATH").and_return('C:\windows\system32;C:\windows;C:\Ruby186\bin')
+ allow(ENV).to receive(:[]).with("PATHEXT").and_return(nil)
allow(File).to receive(:executable?).with('C:\\windows\\system32/gem').and_return(false)
allow(File).to receive(:executable?).with('C:\\windows/gem').and_return(false)
allow(File).to receive(:executable?).with('C:\\Ruby186\\bin/gem').and_return(true)