summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-03-19 05:21:44 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-03-19 05:21:44 +0000
commit4dc72337aca3a4bf81b37bcea8557ef46636aadc (patch)
treee5c415e585af9593f2bda72d281fba280eb9c6c4 /test
parent973f9d05e8f7e722fc23e274c1be54ff8390abf0 (diff)
Fixing #487. I know use "apt-cache policy", instead of apt-cache showpkg, because it clearly shows which version will be installed. This is basically impossible to test well, so I just added a test that verifies we always get a value back, although I cannot really test that it is the "right" value. Also, I modified the logging of packages so if there is a latest version, you will get the new version number, along with the old, in the log.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2310 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rwxr-xr-xtest/ral/providers/package/apt.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/ral/providers/package/apt.rb b/test/ral/providers/package/apt.rb
index 37a4736e5..c1bdcd1ca 100755
--- a/test/ral/providers/package/apt.rb
+++ b/test/ral/providers/package/apt.rb
@@ -69,4 +69,21 @@ class AptPackageProviderTest < PuppetTest::TestCase
pkg.evaluate.each { |state| state.transaction = self; state.forward }
end
+
+ def test_latest
+ pkg = @type.create :name => 'ssh', :provider => :apt
+
+ assert(pkg, "did not create pkg")
+ status = pkg.provider.query
+ assert(status, "ssh is not installed")
+ assert(status[:ensure] != :absent, "ssh is not installed")
+
+ latest = nil
+ assert_nothing_raised("Could not call latest") do
+ latest = pkg.provider.latest
+ end
+ assert(latest, "Could not get latest value from apt")
+ end
end
+
+# $Id$