diff options
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$ |
