[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, master, updated. debian/0.24.6-1-356-g5718585

Luke Kanies luke at madstop.com
Fri Jan 23 14:21:22 UTC 2009


The following commit has been merged in the master branch:
commit 54abe7084da32570f1d4b8522d9d3232c4313d4e
Author: Luke Kanies <luke at madstop.com>
Date:   Wed Oct 8 21:16:26 2008 -0500

    Moving some test/ package tests to rspec integration tests
    and disabling a gem test that hangs forever for me.
    
    Signed-off-by: Luke Kanies <luke at madstop.com>

diff --git a/spec/integration/provider/package.rb b/spec/integration/provider/package.rb
new file mode 100755
index 0000000..24a1962
--- /dev/null
+++ b/spec/integration/provider/package.rb
@@ -0,0 +1,26 @@
+#!/usr/bin/env ruby
+
+Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+
+describe "Package Provider" do
+    Puppet::Type.type(:package).providers.each do |name|
+        provider = Puppet::Type.type(:package).provider(name)
+
+        describe name do
+            confine "Provider %s is not suitable" % name => provider.suitable?
+
+            it "should fail when asked to install an invalid package" do
+                pending("This test hangs forever with recent versions of RubyGems") if provider.name == :gem
+                pkg = Puppet::Type.newpackage :name => "nosuch%s" % provider.name.to_s, :provider => provider.name
+                lambda { pkg.provider.install }.should raise_error
+            end
+
+            it "should be able to get a list of existing packages" do
+                provider.instances.each do |package|
+                    package.should be_instance_of(provider)
+                    package.properties[:provider].should == provider.name
+                end
+            end
+        end
+    end
+end
diff --git a/test/ral/providers/package.rb b/test/ral/providers/package.rb
index f2d28d0..3b61c1a 100755
--- a/test/ral/providers/package.rb
+++ b/test/ral/providers/package.rb
@@ -244,36 +244,5 @@ class TestPackageProvider < Test::Unit::TestCase
             pkg[:adminfile] = "/usr/local/pkg/admin_file"
         end
     end
-
-    # Make sure providers throw an error when you tell them to install a
-    # non-existent package.
-    def test_no_such_package
-        Puppet::Type.type(:package).suitableprovider.each do |provider|
-            assert_raise(ArgumentError, Puppet::Error, Puppet::ExecutionFailure,
-                "Successfully installed nonexistent package with %s" % provider.name) {
-                pkg = Puppet::Type.newpackage :name => "nosuch%s" % provider.name.to_s,
-                    :provider => provider.name
-                provider = pkg.provider
-                provider.install
-            }
-        end
-    end
-
-    # Make sure all of the suitable providers on our platform can successfully
-    # list.
-    def test_instances
-        Puppet::Type.type(:package).suitableprovider.each do |provider|
-            result = nil
-            assert_nothing_raised("Could not list %s packages" % provider.name) do
-                result = provider.instances
-            end
-            result.each do |pkg|
-                assert_instance_of(provider, pkg,
-                    "%s returned non-provider" % provider.name)
-                assert_equal(provider.name, pkg.class.name,
-                    "Provider %s returned an instance of a different provider" %  provider.name)
-            end
-        end
-    end
 end
 

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list