diff options
Diffstat (limited to 'spec')
| -rwxr-xr-x | spec/unit/indirector/key/ca.rb | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/spec/unit/indirector/key/ca.rb b/spec/unit/indirector/key/ca.rb index 579617f71..964b0b0ed 100755 --- a/spec/unit/indirector/key/ca.rb +++ b/spec/unit/indirector/key/ca.rb @@ -12,6 +12,11 @@ describe Puppet::SSL::Key::Ca do Puppet::SSL::Key::Ca.doc.should be_instance_of(String) end + it "should use the :privatekeydir as the collection directory" do + Puppet.settings.expects(:value).with(:privatekeydir).returns "/key/dir" + Puppet::SSL::Key::Ca.collection_directory.should == "/key/dir" + end + it "should store the ca key at the :cakey location" do Puppet.settings.stubs(:use) Puppet.settings.stubs(:value).returns "whatever" @@ -20,15 +25,4 @@ describe Puppet::SSL::Key::Ca do file.stubs(:ca?).returns true file.path("whatever").should == "/ca/key" end - - describe "when choosing the path for the public key" do - it "should fail if the key is not for the CA" do - Puppet.settings.stubs(:use) - Puppet.settings.stubs(:value).returns "whatever" - Puppet.settings.stubs(:value).with(:cakey).returns "/ca/key" - file = Puppet::SSL::Key::Ca.new - file.stubs(:ca?).returns false - lambda { file.path("whatever") }.should raise_error(ArgumentError) - end - end end |
