diff options
Diffstat (limited to 'spec/unit/provider/package/rubygems_spec.rb')
-rw-r--r-- | spec/unit/provider/package/rubygems_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/unit/provider/package/rubygems_spec.rb b/spec/unit/provider/package/rubygems_spec.rb index a3a4772229..b4960b2af3 100644 --- a/spec/unit/provider/package/rubygems_spec.rb +++ b/spec/unit/provider/package/rubygems_spec.rb @@ -536,6 +536,14 @@ describe Chef::Provider::Package::Rubygems do expect(@provider.action_install).to be_truthy end + it "installs the gem by shelling out when options are provided but no version is given" do + @new_resource.options('-i /alt/install/location') + @new_resource.version('') + expected ="gem install \"rspec-core\" -q --no-rdoc --no-ri -i /alt/install/location" + expect(@provider).to receive(:shell_out!).with(expected, :env => nil) + expect(@provider.action_install).to be_truthy + end + it "installs the gem via the gems api when options are given as a Hash" do @new_resource.options(:install_dir => '/alt/install/location') expect(@provider.gem_env).to receive(:install).with(@gem_dep, :sources => nil, :install_dir => '/alt/install/location') |