diff options
author | Luke Kanies <luke@madstop.com> | 2008-11-15 22:29:36 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-11-15 22:29:36 -0600 |
commit | f73e13e7464edab73443857d628602b89361c220 (patch) | |
tree | 8270cf60d2e07fe6afc7feaa8c0760e7fd5cfe34 | |
parent | cc1297031db9b8d3657fb354c7115a7b079a339f (diff) | |
download | puppet-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-x | spec/unit/network/http_pool.rb | 4 | ||||
-rwxr-xr-x | spec/unit/type/file.rb | 18 |
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 |