diff options
author | lucywyman <wyman.lucy@gmail.com> | 2014-11-19 13:38:29 -0800 |
---|---|---|
committer | lucywyman <wyman.lucy@gmail.com> | 2014-11-19 13:38:29 -0800 |
commit | 924d75fd5b79b03e623cc657c5bef73e96f94465 (patch) | |
tree | 9269215631961400949780c568a866ce6caa17da /spec/unit/provider/package | |
parent | 9179b18eeb2e476480fd0a4a4a5f8b36f75e5982 (diff) | |
download | chef-924d75fd5b79b03e623cc657c5bef73e96f94465.tar.gz |
Setting version to an empty string in tests
Check for nil and length on version in package/rubygems tests
In gemspec test change @new_resource.instance_variable_set()
to @new_resource.version()
Diffstat (limited to 'spec/unit/provider/package')
-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') |