diff options
| author | Luke Kanies <luke@madstop.com> | 2008-06-15 16:47:14 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-06-15 16:47:14 -0500 |
| commit | c542dc065fd618ae85bb6e8960d8819f42aefaeb (patch) | |
| tree | 32349ad75c88414e097d249b1be9669f2b5e599c /spec | |
| parent | 7b10c39bdc20cad3d4652008c404d576461d75e1 (diff) | |
| download | puppet-c542dc065fd618ae85bb6e8960d8819f42aefaeb.tar.gz puppet-c542dc065fd618ae85bb6e8960d8819f42aefaeb.tar.xz puppet-c542dc065fd618ae85bb6e8960d8819f42aefaeb.zip | |
Fixing #1168 for REST -- all ssl classes downcase their names.
This is a much cleaner fix than the xmlrpc version, thankfully. :)
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" |
