summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-10-26 14:06:45 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2018-10-26 14:06:45 -0700
commit94343db4afc618619e2bce37863aefbbe49cd9ee (patch)
treeea2a23d8bb914008039960c54fe15e4bbd7c5b0f
parentc0902d1c3aedfb8b151e233e1e65c54589b6fb7b (diff)
downloadchef-lcg/chef-15-shell-out-removal.tar.gz
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--spec/unit/provider/package_spec.rb56
1 files changed, 0 insertions, 56 deletions
diff --git a/spec/unit/provider/package_spec.rb b/spec/unit/provider/package_spec.rb
index 181ac40a1b..f085e09ce4 100644
--- a/spec/unit/provider/package_spec.rb
+++ b/spec/unit/provider/package_spec.rb
@@ -543,24 +543,6 @@ describe "Subclass with use_multipackage_api" do
expect(provider.use_multipackage_api?).to be true
end
- context "#a_to_s utility for subclasses" do
- before(:each) do
- Chef::Config[:treat_deprecation_warnings_as_errors] = false
- end
-
- it "converts varargs of strings to a single string" do
- expect(provider.send(:a_to_s, "a", nil, "b", "", "c", " ", "d e", "f-g")).to eq("a b c d e f-g")
- end
-
- it "converts an array of strings to a single string" do
- expect(provider.send(:a_to_s, ["a", nil, "b", "", "c", " ", "d e", "f-g"])).to eq("a b c d e f-g")
- end
-
- it "converts a mishmash of array args to a single string" do
- expect(provider.send(:a_to_s, "a", [ nil, "b", "", [ "c" ] ], " ", [ "d e", "f-g" ])).to eq("a b c d e f-g")
- end
- end
-
it "when user passes string to package_name, passes arrays to install_package" do
new_resource.package_name "vim"
new_resource.version nil
@@ -951,44 +933,6 @@ describe "Chef::Provider::Package - Multi" do
end
end
- describe "shell_out helpers" do
- before(:each) do
- Chef::Config[:treat_deprecation_warnings_as_errors] = false
- end
-
- [ :shell_out_with_timeout, :shell_out_with_timeout! ].each do |method|
- stubbed_method = method == :shell_out_with_timeout! ? :shell_out_compacted! : :shell_out_compacted
- [ %w{command arg1 arg2}, "command arg1 arg2" ].each do |command|
- it "#{method} defaults to 900 seconds" do
- expect(provider).to receive(stubbed_method).with(*command, timeout: 900)
- provider.send(method, *command)
- end
- it "#{method} overrides the default timeout with its options" do
- expect(provider).to receive(stubbed_method).with(*command, timeout: 1)
- provider.send(method, *command, timeout: 1)
- end
- it "#{method} overrides both timeouts with the new_resource.timeout" do
- new_resource.timeout(99)
- expect(provider).to receive(stubbed_method).with(*command, timeout: 99)
- provider.send(method, *command, timeout: 1)
- end
- it "#{method} defaults to 900 seconds and preserves options" do
- expect(provider).to receive(stubbed_method).with(*command, env: nil, timeout: 900)
- provider.send(method, *command, env: nil)
- end
- it "#{method} overrides the default timeout with its options and preserves options" do
- expect(provider).to receive(stubbed_method).with(*command, timeout: 1, env: nil)
- provider.send(method, *command, timeout: 1, env: nil)
- end
- it "#{method} overrides both timeouts with the new_resource.timeout and preseves options" do
- new_resource.timeout(99)
- expect(provider).to receive(stubbed_method).with(*command, timeout: 99, env: nil)
- provider.send(method, *command, timeout: 1, env: nil)
- end
- end
- end
- end
-
describe "version_compare" do
it "tests equality" do
expect(provider.version_compare("1.3", "1.3")).to eql(0)