summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-04-22 19:22:33 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-04-22 19:22:33 +0000
commitccc4d95dd28164f6f10763a758db85db0d48984c (patch)
treef1f799db506e64b27518cd9f271e282be1b342dc /test
parente64bd22abed67399fd888964d6a18af60c1f3993 (diff)
Modifying non-existent-package test to make sure syncing fails, and modified ports package type to check the error output instead of the return code, because the portinstall command returns 0 even on failure.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1133 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rw-r--r--test/types/package.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/types/package.rb b/test/types/package.rb
index 73e6adf40..f43b051b8 100644
--- a/test/types/package.rb
+++ b/test/types/package.rb
@@ -150,7 +150,8 @@ class TestPackages < Test::Unit::TestCase
obj = nil
assert_nothing_raised {
obj = Puppet.type(:package).create(
- :name => "thispackagedoesnotexist"
+ :name => "thispackagedoesnotexist",
+ :ensure => :installed
)
}
@@ -162,6 +163,13 @@ class TestPackages < Test::Unit::TestCase
assert_equal(:absent, obj.is(:ensure),
"Somehow retrieved unknown pkg's version")
+
+ state = obj.state(:ensure)
+ assert(state, "Could not retrieve ensure state")
+ assert_raise(Puppet::PackageError,
+ "Successfully installed nonexistent package") {
+ state.sync
+ }
end
def test_specifypkgtype