diff options
Diffstat (limited to 'spec/unit/provider/package/freebsd/pkgng_spec.rb')
-rw-r--r-- | spec/unit/provider/package/freebsd/pkgng_spec.rb | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/spec/unit/provider/package/freebsd/pkgng_spec.rb b/spec/unit/provider/package/freebsd/pkgng_spec.rb index 2fdcb87758..13e5dd17fd 100644 --- a/spec/unit/provider/package/freebsd/pkgng_spec.rb +++ b/spec/unit/provider/package/freebsd/pkgng_spec.rb @@ -63,7 +63,7 @@ describe Chef::Provider::Package::Freebsd::Port do describe "determining current installed version" do before(:each) do allow(@provider).to receive(:supports_pkgng?) - @pkg_info = OpenStruct.new(:stdout => "zsh-3.1.7\nVersion : 3.1.7\n") + @pkg_info = OpenStruct.new(stdout: "zsh-3.1.7\nVersion : 3.1.7\n") end it "should query pkg database" do @@ -74,14 +74,14 @@ describe Chef::Provider::Package::Freebsd::Port do describe "determining candidate version" do it "should query repository" do - pkg_query = OpenStruct.new(:stdout => "5.0.5\n", :exitstatus => 0) + pkg_query = OpenStruct.new(stdout: "5.0.5\n", exitstatus: 0) expect(@provider).to receive(:shell_out_compacted!).with("pkg", "rquery", "%v", "zsh", env: nil, timeout: 900).and_return(pkg_query) expect(@provider.candidate_version).to eq("5.0.5") end it "should query specified repository when given option" do @provider.new_resource.options("-r LocalMirror") # This requires LocalMirror repo configuration. - pkg_query = OpenStruct.new(:stdout => "5.0.3\n", :exitstatus => 0) + pkg_query = OpenStruct.new(stdout: "5.0.3\n", exitstatus: 0) expect(@provider).to receive(:shell_out_compacted!).with("pkg", "rquery", "-r", "LocalMirror", "%v", "zsh", env: nil, timeout: 900).and_return(pkg_query) expect(@provider.candidate_version).to eq("5.0.3") end @@ -94,54 +94,54 @@ describe Chef::Provider::Package::Freebsd::Port do describe "installing a binary package" do before(:each) do - @install_result = OpenStruct.new(:status => true) + @install_result = OpenStruct.new(status: true) end 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 describe "removing a binary package" do before(:each) do - @install_result = OpenStruct.new(:status => true) + @install_result = OpenStruct.new(status: true) 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 |