summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit')
-rwxr-xr-xspec/unit/network/http_pool.rb4
-rwxr-xr-xspec/unit/type/file.rb18
2 files changed, 22 insertions, 0 deletions
diff --git a/spec/unit/network/http_pool.rb b/spec/unit/network/http_pool.rb
index f09e8e4ca..0c6a572f2 100755
--- a/spec/unit/network/http_pool.rb
+++ b/spec/unit/network/http_pool.rb
@@ -170,6 +170,10 @@ describe Puppet::Network::HttpPool do
Puppet::Network::HttpPool.stubs(:ssl_host).returns @host
end
+ after do
+ Puppet.settings.clear
+ end
+
it "should do nothing if no certificate is on disk" do
FileTest.expects(:exist?).with("/host/cert").returns false
@http.expects(:cert=).never
diff --git a/spec/unit/type/file.rb b/spec/unit/type/file.rb
index 45f9689a3..0ab4f40bb 100755
--- a/spec/unit/type/file.rb
+++ b/spec/unit/type/file.rb
@@ -69,6 +69,24 @@ describe Puppet::Type.type(:file) do
@file.must_not be_should_be_file
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
require 'puppettest/support/assertions'
include PuppetTest