diff options
Diffstat (limited to 'spec/unit/provider/package/macports_spec.rb')
-rw-r--r-- | spec/unit/provider/package/macports_spec.rb | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/spec/unit/provider/package/macports_spec.rb b/spec/unit/provider/package/macports_spec.rb index b90cf89047..4961f4c467 100644 --- a/spec/unit/provider/package/macports_spec.rb +++ b/spec/unit/provider/package/macports_spec.rb @@ -105,7 +105,7 @@ EOF it "should run the port install command with the correct version" do expect(@current_resource).to receive(:version).and_return("4.1.6") @provider.current_resource = @current_resource - expect(@provider).to receive(:shell_out!).with("port install zsh @4.2.7", timeout: 900) + expect(@provider).to receive(:shell_out!).with("port", "install", "zsh", "@4.2.7", timeout: 900) @provider.install_package("zsh", "4.2.7") end @@ -121,8 +121,8 @@ EOF it "should add options to the port command when specified" do expect(@current_resource).to receive(:version).and_return("4.1.6") @provider.current_resource = @current_resource - allow(@new_resource).to receive(:options).and_return("-f") - expect(@provider).to receive(:shell_out!).with("port -f install zsh @4.2.7", timeout: 900) + @new_resource.options("-f") + expect(@provider).to receive(:shell_out!).with("port", "-f", "install", "zsh", "@4.2.7", timeout: 900) @provider.install_package("zsh", "4.2.7") end @@ -130,36 +130,36 @@ EOF describe "purge_package" do it "should run the port uninstall command with the correct version" do - expect(@provider).to receive(:shell_out!).with("port uninstall zsh @4.2.7", timeout: 900) + expect(@provider).to receive(:shell_out!).with("port", "uninstall", "zsh", "@4.2.7", timeout: 900) @provider.purge_package("zsh", "4.2.7") end it "should purge the currently active version if no explicit version is passed in" do - expect(@provider).to receive(:shell_out!).with("port uninstall zsh", timeout: 900) + expect(@provider).to receive(:shell_out!).with("port", "uninstall", "zsh", timeout: 900) @provider.purge_package("zsh", nil) end it "should add options to the port command when specified" do - allow(@new_resource).to receive(:options).and_return("-f") - expect(@provider).to receive(:shell_out!).with("port -f uninstall zsh @4.2.7", timeout: 900) + @new_resource.options("-f") + expect(@provider).to receive(:shell_out!).with("port", "-f", "uninstall", "zsh", "@4.2.7", timeout: 900) @provider.purge_package("zsh", "4.2.7") end end describe "remove_package" do it "should run the port deactivate command with the correct version" do - expect(@provider).to receive(:shell_out!).with("port deactivate zsh @4.2.7", timeout: 900) + expect(@provider).to receive(:shell_out!).with("port", "deactivate", "zsh", "@4.2.7", timeout: 900) @provider.remove_package("zsh", "4.2.7") end it "should remove the currently active version if no explicit version is passed in" do - expect(@provider).to receive(:shell_out!).with("port deactivate zsh", timeout: 900) + expect(@provider).to receive(:shell_out!).with("port", "deactivate", "zsh", timeout: 900) @provider.remove_package("zsh", nil) end it "should add options to the port command when specified" do - allow(@new_resource).to receive(:options).and_return("-f") - expect(@provider).to receive(:shell_out!).with("port -f deactivate zsh @4.2.7", timeout: 900) + @new_resource.options("-f") + expect(@provider).to receive(:shell_out!).with("port", "-f", "deactivate", "zsh", "@4.2.7", timeout: 900) @provider.remove_package("zsh", "4.2.7") end end @@ -169,7 +169,7 @@ EOF expect(@current_resource).to receive(:version).at_least(:once).and_return("4.1.6") @provider.current_resource = @current_resource - expect(@provider).to receive(:shell_out!).with("port upgrade zsh @4.2.7", timeout: 900) + expect(@provider).to receive(:shell_out!).with("port", "upgrade", "zsh", "@4.2.7", timeout: 900) @provider.upgrade_package("zsh", "4.2.7") end @@ -191,11 +191,11 @@ EOF end it "should add options to the port command when specified" do - allow(@new_resource).to receive(:options).and_return("-f") + @new_resource.options("-f") expect(@current_resource).to receive(:version).at_least(:once).and_return("4.1.6") @provider.current_resource = @current_resource - expect(@provider).to receive(:shell_out!).with("port -f upgrade zsh @4.2.7", timeout: 900) + expect(@provider).to receive(:shell_out!).with("port", "-f", "upgrade", "zsh", "@4.2.7", timeout: 900) @provider.upgrade_package("zsh", "4.2.7") end |