summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorPieter van de Bruggen <pieter@puppetlabs.com>2011-07-25 12:06:35 -0700
committerPieter van de Bruggen <pieter@puppetlabs.com>2011-07-25 12:06:35 -0700
commitd19fc2b34ddbb26c68edf6890588b771ec550cfd (patch)
tree38a7ae9a0ce99f53f5a0e4c64e4ec332a3827a5a /spec
parentd522b0b824285d025884ff271cda957df1c9951d (diff)
parent10e05ad302d1b2d93f5da070d612817729473009 (diff)
downloadpuppet-d19fc2b34ddbb26c68edf6890588b771ec550cfd.tar.gz
puppet-d19fc2b34ddbb26c68edf6890588b771ec550cfd.tar.xz
puppet-d19fc2b34ddbb26c68edf6890588b771ec550cfd.zip
Merge branch 'tickets/2.7.x/7266' into 2.7.x
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/face/certificate_spec.rb20
1 files changed, 16 insertions, 4 deletions
diff --git a/spec/unit/face/certificate_spec.rb b/spec/unit/face/certificate_spec.rb
index 0cb905b75..9291d7523 100755
--- a/spec/unit/face/certificate_spec.rb
+++ b/spec/unit/face/certificate_spec.rb
@@ -10,14 +10,26 @@ describe Puppet::Face[:certificate, '0.0.1'] do
end
it "should set the ca location when invoked" do
- Puppet::SSL::Host.expects(:ca_location=).with(:foo)
+ Puppet::SSL::Host.expects(:ca_location=).with(:local)
Puppet::SSL::Host.indirection.expects(:save)
- subject.sign "hello, friend", :ca_location => :foo
+ subject.sign "hello, friend", :ca_location => :local
end
it "(#7059) should set the ca location when an inherited action is invoked" do
- Puppet::SSL::Host.expects(:ca_location=).with(:foo)
+ Puppet::SSL::Host.expects(:ca_location=).with(:local)
subject.indirection.expects(:find)
- subject.find "hello, friend", :ca_location => :foo
+ subject.find "hello, friend", :ca_location => :local
+ end
+
+ it "should validate the option as required" do
+ expect do
+ subject.find 'hello, friend'
+ end.to raise_exception ArgumentError, /required/i
+ end
+
+ it "should validate the option as a supported value" do
+ expect do
+ subject.find 'hello, friend', :ca_location => :foo
+ end.to raise_exception ArgumentError, /valid values/i
end
end