Adding more file tests and fixing conflicting tests

Signed-off-by: Luke Kanies <luke@madstop.com>
This commit is contained in:
Luke Kanies 2008-11-15 22:29:36 -06:00
Родитель cc1297031d
Коммит f73e13e746
2 изменённых файлов: 22 добавлений и 0 удалений

Просмотреть файл

@ -170,6 +170,10 @@ describe Puppet::Network::HttpPool do
Puppet::Network::HttpPool.stubs(:ssl_host).returns @host Puppet::Network::HttpPool.stubs(:ssl_host).returns @host
end end
after do
Puppet.settings.clear
end
it "should do nothing if no certificate is on disk" do it "should do nothing if no certificate is on disk" do
FileTest.expects(:exist?).with("/host/cert").returns false FileTest.expects(:exist?).with("/host/cert").returns false
@http.expects(:cert=).never @http.expects(:cert=).never

Просмотреть файл

@ -69,6 +69,24 @@ describe Puppet::Type.type(:file) do
@file.must_not be_should_be_file @file.must_not be_should_be_file
end end
describe "when validating attributes" do
%w{path backup recurse source replace force ignore links purge sourceselect}.each do |attr|
it "should have a '#{attr}' parameter" do
Puppet::Type.type(:file).attrtype(attr.intern).should == :param
end
end
%w{checksum content target ensure owner group mode type}.each do |attr|
it "should have a '#{attr}' property" do
Puppet::Type.type(:file).attrtype(attr.intern).should == :property
end
end
it "should have its 'path' attribute set as its namevar" do
Puppet::Type.type(:file).namevar.should == :path
end
end
describe "when managing links" do describe "when managing links" do
require 'puppettest/support/assertions' require 'puppettest/support/assertions'
include PuppetTest include PuppetTest