summaryrefslogtreecommitdiff
path: root/spec/unit/provider/package/smartos_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/provider/package/smartos_spec.rb')
-rw-r--r--spec/unit/provider/package/smartos_spec.rb15
1 files changed, 4 insertions, 11 deletions
diff --git a/spec/unit/provider/package/smartos_spec.rb b/spec/unit/provider/package/smartos_spec.rb
index 6746395dd2..5c86fbefe8 100644
--- a/spec/unit/provider/package/smartos_spec.rb
+++ b/spec/unit/provider/package/smartos_spec.rb
@@ -28,7 +28,6 @@ describe Chef::Provider::Package::SmartOS, "load_current_resource" do
@new_resource = Chef::Resource::Package.new("varnish")
@current_resource = Chef::Resource::Package.new("varnish")
-
@status = double("Status", :exitstatus => 0)
@provider = Chef::Provider::Package::SmartOS.new(@new_resource, @run_context)
allow(Chef::Resource::Package).to receive(:new).and_return(@current_resource)
@@ -40,7 +39,6 @@ describe Chef::Provider::Package::SmartOS, "load_current_resource" do
end
describe "when loading current resource" do
-
it "should create a current resource with the name of the new_resource" do
expect(@provider).to receive(:shell_out!).and_return(@shell_out)
expect(Chef::Resource::Package).to receive(:new).and_return(@current_resource)
@@ -65,8 +63,6 @@ describe Chef::Provider::Package::SmartOS, "load_current_resource" do
@provider.load_current_resource
expect(@current_resource.version).to eq(nil)
end
-
-
end
describe "candidate_version" do
@@ -82,7 +78,7 @@ describe Chef::Provider::Package::SmartOS, "load_current_resource" do
and_yield("something-varnish-1.1.1 something varnish like\n").
and_yield("varnish-2.3.4 actual varnish\n")
@shell_out = double("shell_out!", :stdout => search)
- expect(@provider).to receive(:shell_out!).with("/opt/local/bin/pkgin", "se", "varnish", :env => nil, :returns => [0,1], :timeout=>900).and_return(@shell_out)
+ expect(@provider).to receive(:shell_out!).with("/opt/local/bin/pkgin", "se", "varnish", :env => nil, :returns => [0, 1], :timeout => 900).and_return(@shell_out)
expect(@provider.candidate_version).to eq("2.3.4")
end
@@ -92,21 +88,18 @@ describe Chef::Provider::Package::SmartOS, "load_current_resource" do
and_yield("something-varnish-1.1.1;;something varnish like\n").
and_yield("varnish-2.3.4;;actual varnish\n")
@shell_out = double("shell_out!", :stdout => search)
- expect(@provider).to receive(:shell_out!).with("/opt/local/bin/pkgin", "se", "varnish", :env => nil, :returns => [0,1], :timeout=>900).and_return(@shell_out)
+ expect(@provider).to receive(:shell_out!).with("/opt/local/bin/pkgin", "se", "varnish", :env => nil, :returns => [0, 1], :timeout => 900).and_return(@shell_out)
expect(@provider.candidate_version).to eq("2.3.4")
end
end
describe "when manipulating a resource" do
-
it "run pkgin and install the package" do
out = OpenStruct.new(:stdout => nil)
- expect(@provider).to receive(:shell_out!).with("/opt/local/sbin/pkg_info", "-E", "varnish*", {:env => nil, :returns=>[0,1], :timeout=>900}).and_return(@shell_out)
- expect(@provider).to receive(:shell_out!).with("/opt/local/bin/pkgin", "-y", "install", "varnish-2.1.5nb2", {:env=>nil, :timeout=>900}).and_return(out)
+ expect(@provider).to receive(:shell_out!).with("/opt/local/sbin/pkg_info", "-E", "varnish*", { :env => nil, :returns => [0, 1], :timeout => 900 }).and_return(@shell_out)
+ expect(@provider).to receive(:shell_out!).with("/opt/local/bin/pkgin", "-y", "install", "varnish-2.1.5nb2", { :env => nil, :timeout => 900 }).and_return(out)
@provider.load_current_resource
@provider.install_package("varnish", "2.1.5nb2")
end
-
end
-
end