diff options
author | Jon Ramsey <jonathon.ramsey@gmail.com> | 2011-06-02 17:29:20 +0100 |
---|---|---|
committer | Bryan McLellan <btm@opscode.com> | 2011-06-03 17:07:04 -0700 |
commit | 1ee0ae93a583f940deb955a3ae3602a306de8bc2 (patch) | |
tree | 5e47102c521bec0b5918d27896a44541b154b699 | |
parent | 627b6438883b3d9c98e62f24fb3bfafad4a4c9c8 (diff) | |
download | chef-1ee0ae93a583f940deb955a3ae3602a306de8bc2.tar.gz |
Fixed easy_install package provider to use supplied options.
-rw-r--r-- | chef/lib/chef/provider/package/easy_install.rb | 4 | ||||
-rw-r--r-- | chef/spec/unit/provider/package/easy_install_spec.rb | 18 |
2 files changed, 19 insertions, 3 deletions
diff --git a/chef/lib/chef/provider/package/easy_install.rb b/chef/lib/chef/provider/package/easy_install.rb index 64723db938..6c9dacc55d 100644 --- a/chef/lib/chef/provider/package/easy_install.rb +++ b/chef/lib/chef/provider/package/easy_install.rb @@ -115,7 +115,7 @@ class Chef end def install_package(name, version) - run_command(:command => "#{easy_install_binary_path} \"#{name}==#{version}\"") + run_command(:command => "#{easy_install_binary_path}#{expand_options(@new_resource.options)} \"#{name}==#{version}\"") end def upgrade_package(name, version) @@ -123,7 +123,7 @@ class Chef end def remove_package(name, version) - run_command(:command => "#{easy_install_binary_path} -m #{name}") + run_command(:command => "#{easy_install_binary_path }#{expand_options(@new_resource.options)} -m #{name}") end def purge_package(name, version) diff --git a/chef/spec/unit/provider/package/easy_install_spec.rb b/chef/spec/unit/provider/package/easy_install_spec.rb index 57c0044d3f..4bb0dcf9ce 100644 --- a/chef/spec/unit/provider/package/easy_install_spec.rb +++ b/chef/spec/unit/provider/package/easy_install_spec.rb @@ -38,7 +38,7 @@ describe Chef::Provider::Package::EasyInstall do @pid = 2342 @provider.stub!(:popen4).and_return(@status) end - + describe "easy_install_binary_path" do it "should return a Chef::Provider::EasyInstall object" do @@ -70,6 +70,14 @@ describe Chef::Provider::Package::EasyInstall do @provider.install_package("boto", "1.8d") end + it "should run easy_install with the package name and version and specified options" do + @provider.should_receive(:run_command).with({ + :command => "easy_install --always-unzip \"boto==1.8d\"" + }) + @new_resource.stub!(:options).and_return("--always-unzip") + @provider.install_package("boto", "1.8d") + end + it "should run easy_install with the package name and version" do @provider.should_receive(:run_command).with({ :command => "easy_install \"boto==1.8d\"" @@ -84,6 +92,14 @@ describe Chef::Provider::Package::EasyInstall do @provider.remove_package("boto", "1.8d") end + it "should run easy_install -m with the package name and version and specified options" do + @provider.should_receive(:run_command).with({ + :command => "easy_install -x -m boto" + }) + @new_resource.stub!(:options).and_return("-x") + @provider.remove_package("boto", "1.8d") + end + it "should run easy_install -m with the package name and version" do @provider.should_receive(:run_command).with({ :command => "easy_install -m boto" |