diff options
Diffstat (limited to 'spec/unit')
-rw-r--r-- | spec/unit/sslcertificates/ca_spec.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/unit/sslcertificates/ca_spec.rb b/spec/unit/sslcertificates/ca_spec.rb index aa7e25ff3..b1393b25d 100644 --- a/spec/unit/sslcertificates/ca_spec.rb +++ b/spec/unit/sslcertificates/ca_spec.rb @@ -1,6 +1,6 @@ #!/usr/bin/env ruby - require File.dirname(__FILE__) + '/../../spec_helper' + require 'puppet' require 'puppet/sslcertificates' require 'puppet/sslcertificates/ca' @@ -95,5 +95,16 @@ describe Puppet::SSLCertificates::CA do it 'should store the public key' do File.exists?(Puppet[:capub]).should be_true end + + it 'should prepend "Puppet CA: " to the fqdn as the ca_name by default' do + host_mock_fact = mock() + host_mock_fact.expects(:value).returns('myhost') + domain_mock_fact = mock() + domain_mock_fact.expects(:value).returns('puppetlabs.lan') + Facter.stubs(:[]).with('hostname').returns(host_mock_fact) + Facter.stubs(:[]).with('domain').returns(domain_mock_fact) + + @ca.mkrootcert.name.should == 'Puppet CA: myhost.puppetlabs.lan' + end end end |