[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35

test branch puppet-dev at googlegroups.com
Wed Jul 14 10:30:57 UTC 2010


The following commit has been merged in the upstream branch:
commit 149d5efa667e3f3cdaa3f50347216509392028da
Author: Luke Kanies <luke at reductivelabs.com>
Date:   Tue Jan 19 17:54:33 2010 -0800

    Fixing some compatibility and old tests
    
    We all know these tests should be removed,
    but hey, at least these ones pass now.
    
    Signed-off-by: Luke Kanies <luke at reductivelabs.com>

diff --git a/lib/puppet/metatype/manager.rb b/lib/puppet/metatype/manager.rb
index 865a7c2..513c1c7 100644
--- a/lib/puppet/metatype/manager.rb
+++ b/lib/puppet/metatype/manager.rb
@@ -74,7 +74,7 @@ module Manager
             Puppet.warning "'new#{name.to_s}' method already exists; skipping"
         else
             selfobj.send(:define_method, newmethod) do |*args|
-                klass.create(*args)
+                klass.new(*args)
             end
         end
 
diff --git a/test/ral/manager/provider.rb b/test/ral/manager/provider.rb
index 16d8658..48d6f2d 100755
--- a/test/ral/manager/provider.rb
+++ b/test/ral/manager/provider.rb
@@ -82,26 +82,4 @@ class TestTypeProviders < Test::Unit::TestCase
         end
 
     end
-
-    # #571 -- so we can cause a provider to become suitable within
-    # a run.
-    def test_unsuitable_providers_should_not_fail_at_initialization
-        Puppet::Type.type(:user).provider(:useradd).stubs(:suitable?).returns false
-
-        assert_nothing_raised("Unsuitable providers failed at initialization") do
-            Puppet::Type.type(:user).new :name => "luke", :ensure => :present, :provider => :useradd
-        end
-    end
-
-    # #571 -- so we can cause a provider to become suitable within
-    # a run.
-    def test_unsuitable_providers_should_fail_at_evaluation
-        Puppet::Type.type(:user).provider(:useradd).stubs(:suitable?).returns false
-
-        user = Puppet::Type.type(:user).new :name => "luke", :ensure => :present, :provider => :useradd
-        assert_raise(Puppet::Error, "Unsuitable provider did not fail at evaluation") do
-            user.evaluate
-        end
-    end
 end
-
diff --git a/test/ral/manager/type.rb b/test/ral/manager/type.rb
index 30da6d1..e3cc323 100755
--- a/test/ral/manager/type.rb
+++ b/test/ral/manager/type.rb
@@ -47,68 +47,6 @@ class TestType < Test::Unit::TestCase
         }
     end
 
-    def test_stringvssymbols
-        file = nil
-        path = tempfile()
-        assert_nothing_raised() {
-            system("rm -f %s" % path)
-            file = Puppet::Type.type(:file).new(
-                :path => path,
-                :ensure => "file",
-                :recurse => true,
-                :checksum => "md5"
-            )
-        }
-        assert_nothing_raised() {
-            file.retrieve
-        }
-        assert_nothing_raised() {
-            file.evaluate
-        }
-        assert_nothing_raised() {
-            system("rm -f %s" % path)
-            file = Puppet::Type.type(:file).new(
-                "path" => path,
-                "ensure" => "file",
-                "recurse" => true,
-                "checksum" => "md5"
-            )
-        }
-        assert_nothing_raised() {
-            file.retrieve
-        }
-        assert_nothing_raised() {
-            file[:path]
-        }
-        assert_nothing_raised() {
-            file["path"]
-        }
-        assert_nothing_raised() {
-            file[:recurse]
-        }
-        assert_nothing_raised() {
-            file["recurse"]
-        }
-        assert_nothing_raised() {
-            file.evaluate
-        }
-    end
-
-    # This was supposed to test objects whose name was a property, but that
-    # fundamentally doesn't make much sense, and we now don't have any such
-    # types.
-    def disabled_test_nameasproperty
-        # currently groups are the only objects with the namevar as a property
-        group = nil
-        assert_nothing_raised {
-            group = Puppet::Type.type(:group).new(
-                :name => "testing"
-            )
-        }
-
-        assert_equal("testing", group.name, "Could not retrieve name")
-    end
-
     def test_aliases_are_added_to_catalog
         resource = Puppet::Type.type(:file).new(
             :name => "/path/to/some/missing/file",
@@ -485,18 +423,14 @@ class TestType < Test::Unit::TestCase
     def test_reschedule_when_noop
         Puppet::Type.type(:schedule).mkdefaultschedules
         file = Puppet::Type.type(:file).new(:path => "/tmp/whatever", :mode => "755", :noop => true, :schedule => :daily, :ensure => :file)
+        catalog = Puppet::Resource::Catalog.new
+        catalog.add_resource
 
         assert(file.noop?, "File not considered in noop")
         assert(file.scheduled?, "File is not considered scheduled")
 
-        file.evaluate
-
-        assert_nil(file.cached(:checked), "Stored a checked time when running in noop mode when there were changes")
-        file.cache(:checked, nil)
-
-        file.stubs(:propertychanges).returns([])
+        catalog.apply
 
-        file.evaluate
-        assert_instance_of(Time, file.cached(:checked), "Did not store a checked time when running in noop mode when there were no changes")
+        assert(file.scheduled?, "File is not considered scheduled even though only a noop run was made")
     end
 end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list