~ubuntu-branches/ubuntu/lucid/puppet/lucid-security

« back to all changes in this revision

Viewing changes to spec/unit/indirector/certificate/file.rb

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2009-12-23 00:48:10 UTC
  • mfrom: (1.1.10 upstream) (3.1.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091223004810-3i4oryds922g5n59
Tags: 0.25.1-3ubuntu1
* Merge from debian testing.  Remaining changes:
  - debian/rules:
    + Don't start puppet when first installing puppet.
  - debian/puppet.conf, lib/puppet/defaults.rb:
    + Move templates to /etc/puppet
  - lib/puppet/defaults.rb:
    + Fix /var/lib/puppet/state ownership.
  - man/man8/puppet.conf.8: 
    + Fix broken URL in manpage.
  - debian/control:
    + Update maintainer accordint to spec.
    + Puppetmaster Recommends -> Suggests
    + Created puppet-testsuite as a seperate. Allow the users to run puppet's 
      testsuite.
  - tests/Rakefile: Fix rakefile so that the testsuite can acutally be ran.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env ruby
 
2
#
 
3
#  Created by Luke Kanies on 2008-3-7.
 
4
#  Copyright (c) 2007. All rights reserved.
 
5
 
 
6
require File.dirname(__FILE__) + '/../../../spec_helper'
 
7
 
 
8
require 'puppet/indirector/certificate/file'
 
9
 
 
10
describe Puppet::SSL::Certificate::File do
 
11
    it "should have documentation" do
 
12
        Puppet::SSL::Certificate::File.doc.should be_instance_of(String)
 
13
    end
 
14
 
 
15
    it "should use the :certdir as the collection directory" do
 
16
        Puppet.settings.expects(:value).with(:certdir).returns "/cert/dir"
 
17
        Puppet::SSL::Certificate::File.collection_directory.should == "/cert/dir"
 
18
    end
 
19
 
 
20
    it "should store the ca certificate at the :localcacert location" do
 
21
        Puppet.settings.stubs(:use)
 
22
        Puppet.settings.stubs(:value).returns "whatever"
 
23
        Puppet.settings.stubs(:value).with(:localcacert).returns "/ca/cert"
 
24
        file = Puppet::SSL::Certificate::File.new
 
25
        file.stubs(:ca?).returns true
 
26
        file.path("whatever").should == "/ca/cert"
 
27
    end
 
28
end