summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-09-03 02:49:04 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-09-03 02:49:04 +0000
commitf797487ee2672c7e91b74c57d839cd52102a16d1 (patch)
treeaa1595a97780f7e6f96cb35ac000f0b313add0e3 /test
parentff18e5592467c4b8fe2cedf48cd8f9332e0eff32 (diff)
Fixing #239 -- missing checks now throw an ArgumentError. This will break if any command purposefully returns 127, but that would be a bug anyway, I suppose.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1540 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rwxr-xr-xtest/types/exec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/types/exec.rb b/test/types/exec.rb
index 4f66da517..16979c7ce 100755
--- a/test/types/exec.rb
+++ b/test/types/exec.rb
@@ -531,6 +531,18 @@ class TestExec < Test::Unit::TestCase
assert(! exec.check, "Check passed")
}
end
+
+ def test_missing_checks_cause_failures
+ exec = Puppet::Type.newexec(
+ :command => "echo true",
+ :path => ENV["PATH"],
+ :onlyif => "/bin/nosuchthingexists"
+ )
+
+ assert_raise(ArgumentError, "Missing command did not raise error") {
+ exec.run("/bin/nosuchthingexists")
+ }
+ end
end
# $Id$