summaryrefslogtreecommitdiff
path: root/spec/functional
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-12-15 15:10:00 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-12-15 15:10:00 -0800
commit7b39f6dbfe18653123dbc9459d145dcf7f752479 (patch)
treed5eb18c4a528cbf9c7aba1eab248cfd8c917fe15 /spec/functional
parentee049ed97120993d1ef1ff99e697906e7a541eda (diff)
downloadchef-7b39f6dbfe18653123dbc9459d145dcf7f752479.tar.gz
fix FIXME in define_resource_requirements
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/functional')
-rw-r--r--spec/functional/resource/dnf_package_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/functional/resource/dnf_package_spec.rb b/spec/functional/resource/dnf_package_spec.rb
index a730a8c4b0..c3e812b2cb 100644
--- a/spec/functional/resource/dnf_package_spec.rb
+++ b/spec/functional/resource/dnf_package_spec.rb
@@ -320,6 +320,20 @@ gpgcheck=0
end
context "with source arguments" do
+ it "raises an exception when the package does not exist" do
+ flush_cache
+ dnf_package.package_name("#{CHEF_SPEC_ASSETS}/yumrepo/this-file-better-not-exist.rpm")
+ expect { dnf_package.run_action(:install) }.to raise_error(Chef::Exceptions::Package, /No candidate version available/)
+ end
+
+ it "does not raise a hard exception in why-run mode when the package does not exist" do
+ Chef::Config[:why_run] = true
+ flush_cache
+ dnf_package.package_name("#{CHEF_SPEC_ASSETS}/yumrepo/this-file-better-not-exist.rpm")
+ dnf_package.run_action(:install)
+ expect { dnf_package.run_action(:install) }.not_to raise_error
+ end
+
it "installs the package when using the source argument" do
flush_cache
dnf_package.name "something"