summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-07-18 15:35:15 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-07-18 15:35:15 +0000
commit0b90333d2ca6fb2fa8ff77618851cfb30bd9eead (patch)
tree00c8eb6715a60e713ead90d74b368de1e9624d18 /test
parentaba3d6522f83f86c4d04c864becee4e2bc31d95c (diff)
downloadpuppet-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-xtest/types/cron.rb36
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$