diff options
Diffstat (limited to 'spec')
| -rwxr-xr-x | spec/unit/ssl/certificate.rb | 4 | ||||
| -rwxr-xr-x | spec/unit/ssl/certificate_request.rb | 4 | ||||
| -rwxr-xr-x | spec/unit/ssl/host.rb | 9 | ||||
| -rwxr-xr-x | spec/unit/ssl/key.rb | 4 |
4 files changed, 21 insertions, 0 deletions
diff --git a/spec/unit/ssl/certificate.rb b/spec/unit/ssl/certificate.rb index 1cb164d3f..44918b9c5 100755 --- a/spec/unit/ssl/certificate.rb +++ b/spec/unit/ssl/certificate.rb @@ -34,6 +34,10 @@ describe Puppet::SSL::Certificate do @certificate.name.should == "myname" end + it "should downcase its name" do + @class.new("MyName").name.should == "myname" + end + it "should have a content attribute" do @certificate.should respond_to(:content) end diff --git a/spec/unit/ssl/certificate_request.rb b/spec/unit/ssl/certificate_request.rb index 351e5bbd5..be5aa5a96 100755 --- a/spec/unit/ssl/certificate_request.rb +++ b/spec/unit/ssl/certificate_request.rb @@ -35,6 +35,10 @@ describe Puppet::SSL::CertificateRequest do @request.name.should == "myname" end + it "should downcase its name" do + @class.new("MyName").name.should == "myname" + end + it "should have a content attribute" do @request.should respond_to(:content) end diff --git a/spec/unit/ssl/host.rb b/spec/unit/ssl/host.rb index b717da80e..f282de477 100755 --- a/spec/unit/ssl/host.rb +++ b/spec/unit/ssl/host.rb @@ -162,6 +162,15 @@ describe Puppet::SSL::Host do Puppet::SSL::Host.new.name.should == "myname" end + it "should downcase a passed in name" do + Puppet::SSL::Host.new("Host.Domain.Com").name.should == "host.domain.com" + end + + it "should downcase the certname if it's used" do + Puppet.settings.expects(:value).with(:certname).returns "Host.Domain.Com" + Puppet::SSL::Host.new().name.should == "host.domain.com" + end + it "should indicate that it is a CA host if its name matches the ca_name constant" do Puppet::SSL::Host.stubs(:ca_name).returns "myca" Puppet::SSL::Host.new("myca").should be_ca diff --git a/spec/unit/ssl/key.rb b/spec/unit/ssl/key.rb index 4cd8e856d..b64a8646e 100755 --- a/spec/unit/ssl/key.rb +++ b/spec/unit/ssl/key.rb @@ -38,6 +38,10 @@ describe Puppet::SSL::Key do key.password_file.should == "/ca/pass" end + it "should downcase its name" do + @class.new("MyName").name.should == "myname" + end + it "should set its password file to the default password file if it is not the CA key" do Puppet.settings.stubs(:value).returns "whatever" Puppet.settings.stubs(:value).with(:passfile).returns "/normal/pass" |
