summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2005-06-14 05:12:08 +0000
committerLuke Kanies <luke@madstop.com>2005-06-14 05:12:08 +0000
commit6f074138779e558fd7017880f606dcf3527233f9 (patch)
tree7feb42c545085480a372f947d2bd49f935cd195c /test
parent65c2a6980da355f678b4b579e1ad28e38d51872a (diff)
you can now at least test for whether a package is installed, although you still cannot do anything if it is not -- the barrier is knowing how to get the package
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@300 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rw-r--r--test/types/tc_package.rb35
1 files changed, 33 insertions, 2 deletions
diff --git a/test/types/tc_package.rb b/test/types/tc_package.rb
index 1886b05fb..369ea2520 100644
--- a/test/types/tc_package.rb
+++ b/test/types/tc_package.rb
@@ -24,7 +24,7 @@ class TestPackagingType < Test::Unit::TestCase
end
assert_nothing_raised() {
- Blink::Type::PackagingType[type].list
+ Blink::PackagingType[type].list
}
end
end
@@ -34,8 +34,39 @@ class TestPackageSource < Test::Unit::TestCase
system("touch /tmp/fakepackage")
assert_equal(
"/tmp/fakepackage",
- Blink::Type::PackageSource.get("file:///tmp/fakepackage")
+ Blink::PackageSource.get("file:///tmp/fakepackage")
)
system("rm -f /tmp/fakepackage")
end
end
+
+class TestPackages < Test::Unit::TestCase
+ def setup
+ @list = Blink::Type::Package.getpkglist
+ end
+
+ def teardown
+ Blink::Type::Package.clear
+ end
+
+ def test_checking
+ pkg = nil
+ assert_nothing_raised() {
+ pkg = @list[rand(@list.length)]
+ }
+ assert(pkg)
+ assert_nothing_raised() {
+ pkg.evaluate
+ }
+ assert_nothing_raised() {
+ pkg[:install] = pkg[:install]
+ }
+ assert_nothing_raised() {
+ pkg.evaluate
+ }
+ assert_nothing_raised() {
+ pkg[:install] = "1.2.3.4"
+ }
+ assert(!pkg.insync?)
+ end
+end