summaryrefslogtreecommitdiff
path: root/spec/unit/provider/package/rubygems_spec.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2015-06-02 16:36:46 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2015-06-02 18:52:12 -0700
commit23e3c799803ac1800149e27271c6168539cea25e (patch)
treec6394473fc32f9b30b50a309de765940a21d2c8c /spec/unit/provider/package/rubygems_spec.rb
parent025cabb7158fb02a89250ef91cc94ce3b3c38648 (diff)
downloadchef-23e3c799803ac1800149e27271c6168539cea25e.tar.gz
fix package timeout attribute
updates all the shell_out calls to respect the timeout which is passed on the new_resource. the old `Chef::Config` yum timeout values are still respected and will override the default. the default of 900 seconds is preserved.
Diffstat (limited to 'spec/unit/provider/package/rubygems_spec.rb')
-rw-r--r--spec/unit/provider/package/rubygems_spec.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/unit/provider/package/rubygems_spec.rb b/spec/unit/provider/package/rubygems_spec.rb
index d3cee82623..67ffb7bb9e 100644
--- a/spec/unit/provider/package/rubygems_spec.rb
+++ b/spec/unit/provider/package/rubygems_spec.rb
@@ -508,7 +508,7 @@ describe Chef::Provider::Package::Rubygems do
it "installs the gem by shelling out when options are provided as a String" do
@new_resource.options('-i /alt/install/location')
expected ="gem install rspec-core -q --no-rdoc --no-ri -v \"#{@spec_version}\" -i /alt/install/location"
- expect(@provider).to receive(:shell_out!).with(expected, :env => nil)
+ expect(@provider).to receive(:shell_out!).with(expected, env: nil, timeout: 900)
@provider.run_action(:install)
expect(@new_resource).to be_updated_by_last_action
end
@@ -517,7 +517,7 @@ describe Chef::Provider::Package::Rubygems do
@new_resource.gem_binary('/foo/bar')
@new_resource.source('http://mirror.ops.rhcloud.com/mirror/ruby')
expected ="/foo/bar install rspec-core -q --no-rdoc --no-ri -v \"#{@spec_version}\" --source=#{@new_resource.source} --source=https://rubygems.org"
- expect(@provider).to receive(:shell_out!).with(expected, :env => nil)
+ expect(@provider).to receive(:shell_out!).with(expected, env: nil, timeout: 900)
@provider.run_action(:install)
expect(@new_resource).to be_updated_by_last_action
end
@@ -527,7 +527,7 @@ describe Chef::Provider::Package::Rubygems do
@new_resource.source('http://mirror.ops.rhcloud.com/mirror/ruby')
@new_resource.clear_sources(true)
expected ="/foo/bar install rspec-core -q --no-rdoc --no-ri -v \"#{@spec_version}\" --clear-sources --source=#{@new_resource.source}"
- expect(@provider).to receive(:shell_out!).with(expected, :env => nil)
+ expect(@provider).to receive(:shell_out!).with(expected, env: nil, timeout: 900)
@provider.run_action(:install)
expect(@new_resource).to be_updated_by_last_action
end
@@ -538,7 +538,7 @@ describe Chef::Provider::Package::Rubygems do
it "installs the gem by shelling out when options are provided but no version is given" do
@new_resource.options('-i /alt/install/location')
expected ="gem install rspec-core -q --no-rdoc --no-ri -v \"#{@provider.candidate_version}\" -i /alt/install/location"
- expect(@provider).to receive(:shell_out!).with(expected, :env => nil)
+ expect(@provider).to receive(:shell_out!).with(expected, env: nil, timeout: 900)
@provider.run_action(:install)
expect(@new_resource).to be_updated_by_last_action
end
@@ -584,7 +584,7 @@ describe Chef::Provider::Package::Rubygems do
describe "in an alternate gem environment" do
it "installs the gem by shelling out to gem install" do
@new_resource.gem_binary('/usr/weird/bin/gem')
- expect(@provider).to receive(:shell_out!).with("/usr/weird/bin/gem install rspec-core -q --no-rdoc --no-ri -v \"#{@spec_version}\"", :env=>nil)
+ expect(@provider).to receive(:shell_out!).with("/usr/weird/bin/gem install rspec-core -q --no-rdoc --no-ri -v \"#{@spec_version}\"", env: nil, timeout: 900)
@provider.run_action(:install)
expect(@new_resource).to be_updated_by_last_action
end
@@ -593,7 +593,7 @@ describe Chef::Provider::Package::Rubygems do
@new_resource.gem_binary('/usr/weird/bin/gem')
@new_resource.source(CHEF_SPEC_DATA + '/gems/chef-integration-test-0.1.0.gem')
@new_resource.version('>= 0')
- expect(@provider).to receive(:shell_out!).with("/usr/weird/bin/gem install #{CHEF_SPEC_DATA}/gems/chef-integration-test-0.1.0.gem -q --no-rdoc --no-ri -v \">= 0\"", :env=>nil)
+ expect(@provider).to receive(:shell_out!).with("/usr/weird/bin/gem install #{CHEF_SPEC_DATA}/gems/chef-integration-test-0.1.0.gem -q --no-rdoc --no-ri -v \">= 0\"", env: nil, timeout: 900)
@provider.run_action(:install)
expect(@new_resource).to be_updated_by_last_action
end
@@ -605,7 +605,7 @@ describe Chef::Provider::Package::Rubygems do
@new_resource.gem_binary('/usr/weird/bin/gem')
@new_resource.version('>= 0')
expect(@new_resource.source).to eq(CHEF_SPEC_DATA + '/gems/chef-integration-test-0.1.0.gem')
- expect(@provider).to receive(:shell_out!).with("/usr/weird/bin/gem install #{CHEF_SPEC_DATA}/gems/chef-integration-test-0.1.0.gem -q --no-rdoc --no-ri -v \">= 0\"", :env=>nil)
+ expect(@provider).to receive(:shell_out!).with("/usr/weird/bin/gem install #{CHEF_SPEC_DATA}/gems/chef-integration-test-0.1.0.gem -q --no-rdoc --no-ri -v \">= 0\"", env: nil, timeout: 900)
@provider.run_action(:install)
expect(@new_resource).to be_updated_by_last_action
end
@@ -644,7 +644,7 @@ describe Chef::Provider::Package::Rubygems do
it "uninstalls via the gem command when options are given as a String" do
@new_resource.options('-i /alt/install/location')
- expect(@provider).to receive(:shell_out!).with("gem uninstall rspec -q -x -I -a -i /alt/install/location", :env=>nil)
+ expect(@provider).to receive(:shell_out!).with("gem uninstall rspec -q -x -I -a -i /alt/install/location", env: nil, timeout: 900)
@provider.action_remove
end
@@ -658,7 +658,7 @@ describe Chef::Provider::Package::Rubygems do
describe "in an alternate gem environment" do
it "uninstalls via the gem command" do
@new_resource.gem_binary('/usr/weird/bin/gem')
- expect(@provider).to receive(:shell_out!).with("/usr/weird/bin/gem uninstall rspec -q -x -I -a", :env=>nil)
+ expect(@provider).to receive(:shell_out!).with("/usr/weird/bin/gem uninstall rspec -q -x -I -a", env: nil, timeout: 900)
@provider.action_remove
end
end