summaryrefslogtreecommitdiff
path: root/spec/unit/provider/package
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/provider/package')
-rw-r--r--spec/unit/provider/package/freebsd/pkgng_spec.rb28
-rw-r--r--spec/unit/provider/package/freebsd/port_spec.rb16
-rw-r--r--spec/unit/provider/package/rpm_spec.rb12
-rw-r--r--spec/unit/provider/package/smartos_spec.rb12
4 files changed, 34 insertions, 34 deletions
diff --git a/spec/unit/provider/package/freebsd/pkgng_spec.rb b/spec/unit/provider/package/freebsd/pkgng_spec.rb
index a4da5bb235..13e5dd17fd 100644
--- a/spec/unit/provider/package/freebsd/pkgng_spec.rb
+++ b/spec/unit/provider/package/freebsd/pkgng_spec.rb
@@ -99,30 +99,30 @@ describe Chef::Provider::Package::Freebsd::Port do
it "should handle package source from file" do
@provider.new_resource.source("/nas/pkg/repo/zsh-5.0.1.txz")
- expect(@provider).to receive(:shell_out_compacted!).
- with("pkg", "add", "/nas/pkg/repo/zsh-5.0.1.txz", env: { "LC_ALL" => nil }, timeout: 900).
- and_return(@install_result)
+ expect(@provider).to receive(:shell_out_compacted!)
+ .with("pkg", "add", "/nas/pkg/repo/zsh-5.0.1.txz", env: { "LC_ALL" => nil }, timeout: 900)
+ .and_return(@install_result)
@provider.install_package("zsh", "5.0.1")
end
it "should handle package source over ftp or http" do
@provider.new_resource.source("http://repo.example.com/zsh-5.0.1.txz")
- expect(@provider).to receive(:shell_out_compacted!).
- with("pkg", "add", "http://repo.example.com/zsh-5.0.1.txz", env: { "LC_ALL" => nil }, timeout: 900).
- and_return(@install_result)
+ expect(@provider).to receive(:shell_out_compacted!)
+ .with("pkg", "add", "http://repo.example.com/zsh-5.0.1.txz", env: { "LC_ALL" => nil }, timeout: 900)
+ .and_return(@install_result)
@provider.install_package("zsh", "5.0.1")
end
it "should handle a package name" do
- expect(@provider).to receive(:shell_out_compacted!).
- with("pkg", "install", "-y", "zsh", env: { "LC_ALL" => nil }, timeout: 900).and_return(@install_result)
+ expect(@provider).to receive(:shell_out_compacted!)
+ .with("pkg", "install", "-y", "zsh", env: { "LC_ALL" => nil }, timeout: 900).and_return(@install_result)
@provider.install_package("zsh", "5.0.1")
end
it "should handle a package name with a specified repo" do
@provider.new_resource.options("-r LocalMirror") # This requires LocalMirror repo configuration.
- expect(@provider).to receive(:shell_out_compacted!).
- with("pkg", "install", "-y", "-r", "LocalMirror", "zsh", env: { "LC_ALL" => nil }, timeout: 900).and_return(@install_result)
+ expect(@provider).to receive(:shell_out_compacted!)
+ .with("pkg", "install", "-y", "-r", "LocalMirror", "zsh", env: { "LC_ALL" => nil }, timeout: 900).and_return(@install_result)
@provider.install_package("zsh", "5.0.1")
end
end
@@ -133,15 +133,15 @@ describe Chef::Provider::Package::Freebsd::Port do
end
it "should call pkg delete" do
- expect(@provider).to receive(:shell_out_compacted!).
- with("pkg", "delete", "-y", "zsh-5.0.1", env: nil, timeout: 900).and_return(@install_result)
+ expect(@provider).to receive(:shell_out_compacted!)
+ .with("pkg", "delete", "-y", "zsh-5.0.1", env: nil, timeout: 900).and_return(@install_result)
@provider.remove_package("zsh", "5.0.1")
end
it "should not include repo option in pkg delete" do
@provider.new_resource.options("-r LocalMirror") # This requires LocalMirror repo configuration.
- expect(@provider).to receive(:shell_out_compacted!).
- with("pkg", "delete", "-y", "zsh-5.0.1", env: nil, timeout: 900).and_return(@install_result)
+ expect(@provider).to receive(:shell_out_compacted!)
+ .with("pkg", "delete", "-y", "zsh-5.0.1", env: nil, timeout: 900).and_return(@install_result)
@provider.remove_package("zsh", "5.0.1")
end
end
diff --git a/spec/unit/provider/package/freebsd/port_spec.rb b/spec/unit/provider/package/freebsd/port_spec.rb
index 1406235725..af5216dc04 100644
--- a/spec/unit/provider/package/freebsd/port_spec.rb
+++ b/spec/unit/provider/package/freebsd/port_spec.rb
@@ -98,8 +98,8 @@ describe Chef::Provider::Package::Freebsd::Port do
it "should return candidate version if port exists" do
allow(::File).to receive(:exist?).with("/usr/ports/Makefile").and_return(true)
allow(@provider).to receive(:port_dir).and_return("/usr/ports/shells/zsh")
- expect(@provider).to receive(:shell_out_compacted!).with("make", "-V", "PORTVERSION", cwd: "/usr/ports/shells/zsh", env: nil, returns: [0, 1], timeout: 900).
- and_return(@port_version)
+ expect(@provider).to receive(:shell_out_compacted!).with("make", "-V", "PORTVERSION", cwd: "/usr/ports/shells/zsh", env: nil, returns: [0, 1], timeout: 900)
+ .and_return(@port_version)
expect(@provider.candidate_version).to eq("5.0.5")
end
@@ -140,9 +140,9 @@ describe Chef::Provider::Package::Freebsd::Port do
it "should run make install in port directory" do
allow(@provider).to receive(:port_dir).and_return("/usr/ports/shells/zsh")
- expect(@provider).to receive(:shell_out_compacted!).
- with("make", "-DBATCH", "install", "clean", timeout: 1800, cwd: "/usr/ports/shells/zsh", env: nil).
- and_return(@install_result)
+ expect(@provider).to receive(:shell_out_compacted!)
+ .with("make", "-DBATCH", "install", "clean", timeout: 1800, cwd: "/usr/ports/shells/zsh", env: nil)
+ .and_return(@install_result)
@provider.install_package("zsh", "5.0.5")
end
end
@@ -154,9 +154,9 @@ describe Chef::Provider::Package::Freebsd::Port do
it "should run make deinstall in port directory" do
allow(@provider).to receive(:port_dir).and_return("/usr/ports/shells/zsh")
- expect(@provider).to receive(:shell_out_compacted!).
- with("make", "deinstall", timeout: 300, cwd: "/usr/ports/shells/zsh", env: nil).
- and_return(@install_result)
+ expect(@provider).to receive(:shell_out_compacted!)
+ .with("make", "deinstall", timeout: 300, cwd: "/usr/ports/shells/zsh", env: nil)
+ .and_return(@install_result)
@provider.remove_package("zsh", "5.0.5")
end
end
diff --git a/spec/unit/provider/package/rpm_spec.rb b/spec/unit/provider/package/rpm_spec.rb
index 91d4ca69b4..3682043dcd 100644
--- a/spec/unit/provider/package/rpm_spec.rb
+++ b/spec/unit/provider/package/rpm_spec.rb
@@ -85,13 +85,13 @@ describe Chef::Provider::Package::Rpm do
describe "when the package source is valid" do
before do
- expect(provider).to receive(:shell_out_compacted!).
- with("rpm", "-qp", "--queryformat", "%{NAME} %{VERSION}-%{RELEASE}\n", package_source, timeout: 900).
- and_return(rpm_qp_status)
+ expect(provider).to receive(:shell_out_compacted!)
+ .with("rpm", "-qp", "--queryformat", "%{NAME} %{VERSION}-%{RELEASE}\n", package_source, timeout: 900)
+ .and_return(rpm_qp_status)
- expect(provider).to receive(:shell_out_compacted).
- with("rpm", "-q", "--queryformat", "%{NAME} %{VERSION}-%{RELEASE}\n", package_name, timeout: 900).
- and_return(rpm_q_status)
+ expect(provider).to receive(:shell_out_compacted)
+ .with("rpm", "-q", "--queryformat", "%{NAME} %{VERSION}-%{RELEASE}\n", package_name, timeout: 900)
+ .and_return(rpm_q_status)
end
context "when rpm fails when querying package installed state" do
diff --git a/spec/unit/provider/package/smartos_spec.rb b/spec/unit/provider/package/smartos_spec.rb
index 172bfbac84..cd85e1b3d9 100644
--- a/spec/unit/provider/package/smartos_spec.rb
+++ b/spec/unit/provider/package/smartos_spec.rb
@@ -76,9 +76,9 @@ describe Chef::Provider::Package::SmartOS, "load_current_resource" do
it "should lookup the candidate_version if the variable is not already set (pkgin separated by spaces)" do
search = double()
- expect(search).to receive(:each_line).
- and_yield("something-varnish-1.1.1 something varnish like\n").
- and_yield("varnish-2.3.4 actual varnish\n")
+ expect(search).to receive(:each_line)
+ .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_compacted!).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")
@@ -86,9 +86,9 @@ describe Chef::Provider::Package::SmartOS, "load_current_resource" do
it "should lookup the candidate_version if the variable is not already set (pkgin separated by semicolons)" do
search = double()
- expect(search).to receive(:each_line).
- and_yield("something-varnish-1.1.1;;something varnish like\n").
- and_yield("varnish-2.3.4;;actual varnish\n")
+ expect(search).to receive(:each_line)
+ .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_compacted!).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")