diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-07-18 15:35:15 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-07-18 15:35:15 +0000 |
| commit | 0b90333d2ca6fb2fa8ff77618851cfb30bd9eead (patch) | |
| tree | 00c8eb6715a60e713ead90d74b368de1e9624d18 /test | |
| parent | aba3d6522f83f86c4d04c864becee4e2bc31d95c (diff) | |
| download | puppet-0b90333d2ca6fb2fa8ff77618851cfb30bd9eead.tar.gz puppet-0b90333d2ca6fb2fa8ff77618851cfb30bd9eead.tar.xz puppet-0b90333d2ca6fb2fa8ff77618851cfb30bd9eead.zip | |
Fixing #191. I was only testing for parsed cron instances, not for created ones.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1402 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
| -rwxr-xr-x | test/types/cron.rb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/types/cron.rb b/test/types/cron.rb index 3b6384d59..fee09b360 100755 --- a/test/types/cron.rb +++ b/test/types/cron.rb @@ -35,6 +35,7 @@ class TestCron < Test::Unit::TestCase def teardown @crontype.filetype = @oldfiletype + Puppet::FileType.filetype(:ram).clear super end @@ -677,6 +678,41 @@ class TestCron < Test::Unit::TestCase assert(list.include?(cron.name), "Did not match cron %s" % name) end end + + # Make sure we can create a cron in an empty tab + def test_mkcron_if_empty + @crontype.filetype = @oldfiletype + + @crontype.retrieve(@me) + + # Backup our tab + text = @crontype.tabobj(@me).read + + cleanup do + if text == "" + @crontype.tabobj(@me).remove + else + @crontype.tabobj(@me).write(text) + end + end + + # Now get rid of it + @crontype.tabobj(@me).remove + @crontype.clear + + cron = mkcron("emptycron") + + assert_apply(cron) + + # Clear the type, but don't clear the filetype + @crontype.clear + + # Get the stuff again + @crontype.retrieve(@me) + + assert(@crontype["emptycron"], + "Did not retrieve cron") + end end # $Id$ |
