diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-09-15 01:01:08 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-09-15 01:01:08 +0000 |
| commit | 3b8c9ff8235e1a2cfc7e17dae9933979e10264b3 (patch) | |
| tree | fa1a111a1455b5a25902312623f8b3d84c209f88 /test | |
| parent | bf5d0bc3cd4fd688aae2c0b1b93c32ddcbf3983c (diff) | |
Fixing #269. I was aliasing every case where the title and name were different, where I should only have been aliasing isomorphic types, which does not include exec
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1595 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
| -rw-r--r-- | test/types/type.rb | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/test/types/type.rb b/test/types/type.rb index a98ab26ae..420024fb3 100644 --- a/test/types/type.rb +++ b/test/types/type.rb @@ -706,6 +706,51 @@ end assert_equal(greater, type.defaultprovider) end + + # Make sure that we can have multiple isomorphic objects with the same name, + # but not with non-isomorphic objects. + def test_isomorphic_names + # First do execs, since they're not isomorphic. + echo = Puppet::Util.binary "echo" + exec1 = exec2 = nil + assert_nothing_raised do + exec1 = Puppet::Type.type(:exec).create( + :title => "exec1", + :command => "#{echo} funtest" + ) + end + assert_nothing_raised do + exec2 = Puppet::Type.type(:exec).create( + :title => "exec2", + :command => "#{echo} funtest" + ) + end + + assert_apply(exec1, exec2) + + # Now do files, since they are. This should fail. + file1 = file2 = nil + path = tempfile() + assert_nothing_raised do + file1 = Puppet::Type.type(:file).create( + :title => "file1", + :path => path, + :content => "yayness" + ) + end + + # This will fail, but earlier systems will catch it. + assert_nothing_raised do + file2 = Puppet::Type.type(:file).create( + :title => "file2", + :path => path, + :content => "rahness" + ) + end + + assert(file1, "Did not create first file") + assert_nil(file2, "Incorrectly created second file") + end end # $Id$ |
