summaryrefslogtreecommitdiff
path: root/spec/unit/resource
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2019-05-07 10:41:08 -0700
committerGitHub <noreply@github.com>2019-05-07 10:41:08 -0700
commitb2c16e5438b43f0154d0cd61cea3cc6ff00433b9 (patch)
tree84e7fa1a53126927330e71c6865b7b2e2a60817d /spec/unit/resource
parent3f39c7eb9a5f0eadf768cc92630744f66242dfa3 (diff)
parent38c62c0c14794045154d886ffaf6f27778e659dd (diff)
downloadchef-b2c16e5438b43f0154d0cd61cea3cc6ff00433b9.tar.gz
Merge pull request #8307 from MsysTechnologiesllc/Kapil/MSYS-986_Move_response_file_and_response_file_variables_out_of_base_package_resource
package: move response_file and response_file_variables out of base package resource
Diffstat (limited to 'spec/unit/resource')
-rw-r--r--spec/unit/resource/apt_package_spec.rb10
-rw-r--r--spec/unit/resource/dpkg_package_spec.rb10
-rw-r--r--spec/unit/resource/package_spec.rb10
3 files changed, 20 insertions, 10 deletions
diff --git a/spec/unit/resource/apt_package_spec.rb b/spec/unit/resource/apt_package_spec.rb
index 66fe05ef33..c39c768ae2 100644
--- a/spec/unit/resource/apt_package_spec.rb
+++ b/spec/unit/resource/apt_package_spec.rb
@@ -53,4 +53,14 @@ describe Chef::Resource::AptPackage, "initialize" do
it "should preserve configuration files by default" do
expect(resource.overwrite_config_files).to eql(false)
end
+
+ it "accepts a string for the response file" do
+ resource.response_file "something"
+ expect(resource.response_file).to eql("something")
+ end
+
+ it "accepts a hash for response file template variables" do
+ resource.response_file_variables({ variables: true })
+ expect(resource.response_file_variables).to eql({ variables: true })
+ end
end
diff --git a/spec/unit/resource/dpkg_package_spec.rb b/spec/unit/resource/dpkg_package_spec.rb
index ff32d7e413..562dbeef76 100644
--- a/spec/unit/resource/dpkg_package_spec.rb
+++ b/spec/unit/resource/dpkg_package_spec.rb
@@ -36,6 +36,16 @@ describe Chef::Resource::DpkgPackage, "initialize" do
expect(resource.action).to eql([:install])
end
+ it "accepts a string for the response file" do
+ resource.response_file "something"
+ expect(resource.response_file).to eql("something")
+ end
+
+ it "accepts a hash for response file template variables" do
+ resource.response_file_variables({ variables: true })
+ expect(resource.response_file_variables).to eql({ variables: true })
+ end
+
it "supports :install, :lock, :purge, :reconfig, :remove, :unlock, :upgrade actions" do
expect { resource.action :install }.not_to raise_error
expect { resource.action :lock }.not_to raise_error
diff --git a/spec/unit/resource/package_spec.rb b/spec/unit/resource/package_spec.rb
index b0e1304775..6e3d609e4b 100644
--- a/spec/unit/resource/package_spec.rb
+++ b/spec/unit/resource/package_spec.rb
@@ -50,16 +50,6 @@ describe Chef::Resource::Package do
expect(resource.version).to eql("something")
end
- it "accepts a string for the response file" do
- resource.response_file "something"
- expect(resource.response_file).to eql("something")
- end
-
- it "accepts a hash for response file template variables" do
- resource.response_file_variables({ variables: true })
- expect(resource.response_file_variables).to eql({ variables: true })
- end
-
it "accepts a string for the source" do
resource.source "something"
expect(resource.source).to eql("something")