From e538037d00fe0a5eb71444383985969e308684b7 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Wed, 12 Aug 2020 20:12:58 -0700 Subject: Add unit and integration testing back to omnibus testers It is slow but it does catch real bugs Signed-off-by: Lamont Granquist --- spec/unit/provider/package/powershell_spec.rb | 2 +- spec/unit/provider/package/rubygems_spec.rb | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'spec/unit/provider') 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) -- cgit v1.2.1