diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-02-16 19:10:34 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-02-16 19:10:34 +0000 |
| commit | 1fdb96266e2d1a083e1ecc76c5ae136ba73f2999 (patch) | |
| tree | d600505c4b15bb699c9531903e6647102292a697 /test | |
| parent | 5f8d61553a9d83087604fe5b68146503cf55d1be (diff) | |
| download | puppet-1fdb96266e2d1a083e1ecc76c5ae136ba73f2999.tar.gz puppet-1fdb96266e2d1a083e1ecc76c5ae136ba73f2999.tar.xz puppet-1fdb96266e2d1a083e1ecc76c5ae136ba73f2999.zip | |
Changing transactions to be one-stage instead of two, and changing most of the type classes to use "obj[:name]" instead of "obj.name" where appropriate, because "obj.name" might be a symbolic name (e.g., File.unlink(file.name) will not do what you want if file.name == "sshdconfig" but file[:path] == "/etc/ssh/sshd_config")
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@922 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
| -rwxr-xr-x | test/types/exec.rb | 6 | ||||
| -rw-r--r-- | test/types/file.rb | 17 | ||||
| -rwxr-xr-x | test/types/group.rb | 5 |
3 files changed, 24 insertions, 4 deletions
diff --git a/test/types/exec.rb b/test/types/exec.rb index 004cd6c29..cb40d4f5c 100755 --- a/test/types/exec.rb +++ b/test/types/exec.rb @@ -146,6 +146,7 @@ class TestExec < Test::Unit::TestCase events = nil assert_nothing_raised { trans = comp.evaluate + file.retrieve sum = file.state(:checksum) assert_equal(sum.is, sum.should) @@ -262,8 +263,9 @@ class TestExec < Test::Unit::TestCase assert(!exec.requires?(ofile), "Exec incorrectly required file") # Verify that we catch inline files - assert(cat.requires?(ofile), "Exec did not catch second inline file") - assert(cat.requires?(file), "Exec did not catch inline file") + # We not longer autorequire inline files + assert(! cat.requires?(ofile), "Exec required second inline file") + assert(! cat.requires?(file), "Exec required inline file") end def test_ifonly diff --git a/test/types/file.rb b/test/types/file.rb index b1172c0a8..e6d81a7a3 100644 --- a/test/types/file.rb +++ b/test/types/file.rb @@ -736,6 +736,23 @@ class TestFile < Test::Unit::TestCase assert_events([], file) assert_events([], file) end + + def test_nameandpath + path = tempfile() + + file = nil + assert_nothing_raised { + file = Puppet.type(:file).create( + :name => "fileness", + :path => path, + :content => "this is some content" + ) + } + + assert_apply(file) + + assert(FileTest.exists?(path)) + end end # $Id$ diff --git a/test/types/group.rb b/test/types/group.rb index e1b4e4fed..e044949e6 100755 --- a/test/types/group.rb +++ b/test/types/group.rb @@ -180,9 +180,10 @@ class TestGroup < Test::Unit::TestCase comp = newcomp("grouptest %s" % group, gobj) } - trans = nil + #trans = nil assert_nothing_raised { - trans = comp.evaluate + gobj.retrieve + #trans = comp.evaluate } assert(gobj.is(:gid), "Failed to retrieve gid") |
