summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-11-15 22:29:36 -0600
committerLuke Kanies <luke@madstop.com>2008-11-15 22:29:36 -0600
commitf73e13e7464edab73443857d628602b89361c220 (patch)
tree8270cf60d2e07fe6afc7feaa8c0760e7fd5cfe34
parentcc1297031db9b8d3657fb354c7115a7b079a339f (diff)
downloadpuppet-f73e13e7464edab73443857d628602b89361c220.tar.gz
puppet-f73e13e7464edab73443857d628602b89361c220.tar.xz
puppet-f73e13e7464edab73443857d628602b89361c220.zip
Adding more file tests and fixing conflicting tests
Signed-off-by: Luke Kanies <luke@madstop.com>
-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