summaryrefslogtreecommitdiff
path: root/spec/unit/indirector/certificate/file_spec.rb
blob: fff00ea3a2aec6eb5906c8528922a8569c35eb87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! /usr/bin/env ruby
require 'spec_helper'

require 'puppet/indirector/certificate/file'

describe Puppet::SSL::Certificate::File do
  it "should have documentation" do
    Puppet::SSL::Certificate::File.doc.should be_instance_of(String)
  end

  it "should use the :certdir as the collection directory" do
    Puppet[:certdir] = File.expand_path("/cert/dir")
    Puppet::SSL::Certificate::File.collection_directory.should == Puppet[:certdir]
  end

  it "should store the ca certificate at the :localcacert location" do
    Puppet.settings.stubs(:use)
    Puppet[:localcacert] = File.expand_path("/ca/cert")
    file = Puppet::SSL::Certificate::File.new
    file.stubs(:ca?).returns true
    file.path("whatever").should == Puppet[:localcacert]
  end
end