summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-02-07 17:48:51 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-02-07 17:48:51 +0000
commit99c8a548c7980408cde0ffc51a3b7685a4965978 (patch)
treed48b0bb7e179c90e53909466fc31395fef09e272 /test
parentdd71a514b6970d3b4f8167a4f29849b1b1fc631d (diff)
Adding a parameter to allow you to override how an exec refreshes itself.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2173 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rwxr-xr-xtest/ral/types/exec.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/ral/types/exec.rb b/test/ral/types/exec.rb
index d16392921..300e26367 100755
--- a/test/ral/types/exec.rb
+++ b/test/ral/types/exec.rb
@@ -700,7 +700,37 @@ and stuff"
exec.refresh
end
assert(! FileTest.exists?(maker), "exec refreshed with failing checks")
+ end
+
+ def test_explicit_refresh
+ refresher = tempfile()
+ maker = tempfile()
+ exec = Puppet::Type.type(:exec).create(
+ :title => "maker",
+ :command => "touch #{maker}",
+ :path => ENV["PATH"]
+ )
+
+ # Call refresh normally
+ assert_nothing_raised do
+ exec.refresh
+ end
+
+ # Make sure it created the normal file
+ assert(FileTest.exists?(maker), "normal refresh did not work")
+ File.unlink(maker)
+
+ # Now reset refresh, and make sure it wins
+ assert_nothing_raised("Could not set refresh parameter") do
+ exec[:refresh] = "touch #{refresher}"
+ end
+ assert_nothing_raised do
+ exec.refresh
+ end
+ # Make sure it created the normal file
+ assert(FileTest.exists?(refresher), "refresh param was ignored")
+ assert(! FileTest.exists?(maker), "refresh param also ran command")
end
end