From 1d35f2822aaa673cb6f3ea6da9c773b89ccb25ee Mon Sep 17 00:00:00 2001 From: luke Date: Tue, 17 Oct 2006 22:45:57 +0000 Subject: Fixing a bug that only occurred if a defined resource was already defined in memory. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1803 980ebf18-57e1-0310-9a29-db15c13687c0 --- test/types/type.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test') diff --git a/test/types/type.rb b/test/types/type.rb index 2add25db3..2438503c8 100755 --- a/test/types/type.rb +++ b/test/types/type.rb @@ -784,6 +784,20 @@ end assert(hash[param], "Hash did not include %s" % param) end end + + # Make sure that classes behave like hashes. + def test_class_hash_behaviour + path = tempfile() + + filetype = Puppet::Type.type(:file) + one = Puppet::Type.newfile :path => path + + assert_equal(one, filetype[path], "Did not get file back") + + assert_raise(Puppet::Error) do + filetype[path] = one + end + end end # $Id$ -- cgit