diff options
author | Jeremy Fleischman <jeremyfleischman@gmail.com> | 2015-05-18 13:24:13 -0700 |
---|---|---|
committer | Jeremy Fleischman <jeremyfleischman@gmail.com> | 2015-05-18 13:24:13 -0700 |
commit | b8f4066d59a7e90980856c4e963ed423252d1337 (patch) | |
tree | ab880b2fd279cdd34e8a250848700e89caeabef1 | |
parent | 742c46a5477333156a57a61f961881dd5cb9cd91 (diff) | |
download | chef-b8f4066d59a7e90980856c4e963ed423252d1337.tar.gz |
Added some pretty straightforward tests of is_omnibus?
-rw-r--r-- | spec/unit/provider/package/rubygems_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/unit/provider/package/rubygems_spec.rb b/spec/unit/provider/package/rubygems_spec.rb index 380572499c..cd3a90e0de 100644 --- a/spec/unit/provider/package/rubygems_spec.rb +++ b/spec/unit/provider/package/rubygems_spec.rb @@ -403,6 +403,24 @@ describe Chef::Provider::Package::Rubygems do expect(provider.gem_env.gem_binary_location).to eq('/usr/weird/bin/gem') end + it "recognizes chef as omnibus" do + allow(RbConfig::CONFIG).to receive(:[]).with('bindir').and_return("/opt/chef/embedded/bin") + provider = Chef::Provider::Package::Rubygems.new(@new_resource, @run_context) + expect(provider.is_omnibus?).to be true + end + + it "recognizes opscode as omnibus" do + allow(RbConfig::CONFIG).to receive(:[]).with('bindir').and_return("/opt/opscode/embedded/bin") + provider = Chef::Provider::Package::Rubygems.new(@new_resource, @run_context) + expect(provider.is_omnibus?).to be true + end + + it "recognizes chefdk as omnibus" do + allow(RbConfig::CONFIG).to receive(:[]).with('bindir').and_return("/opt/chefdk/embedded/bin") + provider = Chef::Provider::Package::Rubygems.new(@new_resource, @run_context) + expect(provider.is_omnibus?).to be true + end + it "searches for a gem binary when running on Omnibus on Unix" do platform_mock :unix do allow(RbConfig::CONFIG).to receive(:[]).with('bindir').and_return("/opt/chef/embedded/bin") |