3
# Created by Luke Kanies on 2008-3-7.
4
# Copyright (c) 2007. All rights reserved.
6
require File.dirname(__FILE__) + '/../../../spec_helper'
8
require 'puppet/indirector/certificate/file'
10
describe Puppet::SSL::Certificate::File do
11
it "should have documentation" do
12
Puppet::SSL::Certificate::File.doc.should be_instance_of(String)
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"
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"