summaryrefslogtreecommitdiff
path: root/spec/unit/provider/package/openbsd_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/provider/package/openbsd_spec.rb')
-rw-r--r--spec/unit/provider/package/openbsd_spec.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/spec/unit/provider/package/openbsd_spec.rb b/spec/unit/provider/package/openbsd_spec.rb
index 07950acf6e..01d6571f65 100644
--- a/spec/unit/provider/package/openbsd_spec.rb
+++ b/spec/unit/provider/package/openbsd_spec.rb
@@ -45,7 +45,7 @@ describe Chef::Provider::Package::Openbsd do
context "when not already installed" do
before do
- allow(provider).to receive(:shell_out_compacted!).with("pkg_info", "-e", "#{name}->0", anything()).and_return(instance_double("shellout", :stdout => ""))
+ allow(provider).to receive(:shell_out_compacted!).with("pkg_info", "-e", "#{name}->0", anything()).and_return(instance_double("shellout", stdout: ""))
end
context "when there is a single candidate" do
@@ -53,11 +53,11 @@ describe Chef::Provider::Package::Openbsd do
context "when source is not provided" do
it "should run the installation command" do
expect(provider).to receive(:shell_out_compacted!).with("pkg_info", "-I", name, anything()).and_return(
- instance_double("shellout", :stdout => "#{name}-#{version}\n"))
+ instance_double("shellout", stdout: "#{name}-#{version}\n"))
expect(provider).to receive(:shell_out_compacted!).with(
"pkg_add", "-r", "#{name}-#{version}",
- { :env => { "PKG_PATH" => "http://ftp.OpenBSD.org/pub/OpenBSD/5.5/packages/amd64/" }, timeout: 900 }
- ) { OpenStruct.new :status => true }
+ { env: { "PKG_PATH" => "http://ftp.OpenBSD.org/pub/OpenBSD/5.5/packages/amd64/" }, timeout: 900 }
+ ) { OpenStruct.new status: true }
provider.run_action(:install)
end
end
@@ -70,7 +70,7 @@ describe Chef::Provider::Package::Openbsd do
context "if no version is specified" do
it "should raise an exception" do
expect(provider).to receive(:shell_out_compacted!).with("pkg_info", "-I", name, anything()).and_return(
- instance_double("shellout", :stdout => "#{name}-#{version}-#{flavor_a}\n#{name}-#{version}-#{flavor_b}\n"))
+ instance_double("shellout", stdout: "#{name}-#{version}-#{flavor_a}\n#{name}-#{version}-#{flavor_b}\n"))
expect { provider.run_action(:install) }.to raise_error(Chef::Exceptions::Package, /multiple matching candidates/)
end
end
@@ -83,13 +83,13 @@ describe Chef::Provider::Package::Openbsd do
context "if no version is specified" do
it "should run the installation command" do
- expect(provider).to receive(:shell_out_compacted!).with("pkg_info", "-e", "#{package_name}->0", anything()).and_return(instance_double("shellout", :stdout => ""))
+ expect(provider).to receive(:shell_out_compacted!).with("pkg_info", "-e", "#{package_name}->0", anything()).and_return(instance_double("shellout", stdout: ""))
expect(provider).to receive(:shell_out_compacted!).with("pkg_info", "-I", name, anything()).and_return(
- instance_double("shellout", :stdout => "#{name}-#{version}-#{flavor}\n"))
+ instance_double("shellout", stdout: "#{name}-#{version}-#{flavor}\n"))
expect(provider).to receive(:shell_out_compacted!).with(
"pkg_add", "-r", "#{name}-#{version}-#{flavor}",
{ env: { "PKG_PATH" => "http://ftp.OpenBSD.org/pub/OpenBSD/5.5/packages/amd64/" }, timeout: 900 }
- ) { OpenStruct.new :status => true }
+ ) { OpenStruct.new status: true }
provider.run_action(:install)
end
end
@@ -99,13 +99,13 @@ describe Chef::Provider::Package::Openbsd do
context "if a version is specified" do
it "should use the flavor from the version" do
expect(provider).to receive(:shell_out_compacted!).with("pkg_info", "-I", "#{name}-#{version}-#{flavor_b}", anything()).and_return(
- instance_double("shellout", :stdout => "#{name}-#{version}-#{flavor_a}\n"))
+ instance_double("shellout", stdout: "#{name}-#{version}-#{flavor_a}\n"))
new_resource.version("#{version}-#{flavor_b}")
expect(provider).to receive(:shell_out_compacted!).with(
"pkg_add", "-r", "#{name}-#{version}-#{flavor_b}",
{ env: { "PKG_PATH" => "http://ftp.OpenBSD.org/pub/OpenBSD/5.5/packages/amd64/" }, timeout: 900 }
- ) { OpenStruct.new :status => true }
+ ) { OpenStruct.new status: true }
provider.run_action(:install)
end
end
@@ -124,7 +124,7 @@ describe Chef::Provider::Package::Openbsd do
it "should run the command to delete the installed package" do
expect(@provider).to receive(:shell_out_compacted!).with(
"pkg_delete", @name, env: nil, timeout: 900
- ) { OpenStruct.new :status => true }
+ ) { OpenStruct.new status: true }
@provider.remove_package(@name, nil)
end
end