[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:31:20 UTC 2010


The following commit has been merged in the upstream branch:
commit 177907935b62fe01e5de182abb6c9c21f2f3bfd4
Author: Jesse Wolfe <jes5199 at gmail.com>
Date:   Wed Apr 7 12:17:19 2010 -0700

    Remove stale set_trigger
    
    Delete tests that are superceded by specs in "Changing Transaction to
    use the new ResourceHarness"

diff --git a/test/other/transactions.rb b/test/other/transactions.rb
index baf6def..57aa234 100755
--- a/test/other/transactions.rb
+++ b/test/other/transactions.rb
@@ -554,103 +554,6 @@ class TestTransactions < Test::Unit::TestCase
         assert(FileTest.exists?(maker), "Did not make callback file")
     end
 
-    # Yay, this out to be fun.
-    def test_trigger
-        $triggered = []
-        cleanup { $triggered = nil }
-        trigger = Class.new do
-            attr_accessor :name
-            include Puppet::Util::Logging
-            def initialize(name)
-                @name = name
-            end
-            def ref
-                self.name
-            end
-            def refresh
-                $triggered << self.name
-            end
-
-            def to_s
-                self.name
-            end
-        end
-
-        # Make a graph with some stuff in it.
-        graph = Puppet::Resource::Catalog.new
-
-        # Add a non-triggering edge.
-        a = trigger.new(:a)
-        b = trigger.new(:b)
-        c = trigger.new(:c)
-        nope = Puppet::Relationship.new(a, b)
-        yep = Puppet::Relationship.new(a, c, {:callback => :refresh})
-        graph.add_edge(nope)
-
-        # And a triggering one.
-        graph.add_edge(yep)
-
-        # Create our transaction
-        trans = Puppet::Transaction.new(graph)
-
-        # Set the non-triggering on
-        assert_nothing_raised do
-            trans.set_trigger(nope)
-        end
-
-        assert(! trans.targeted?(b), "b is incorrectly targeted")
-
-        # Now set the other
-        assert_nothing_raised do
-            trans.set_trigger(yep)
-        end
-        assert(trans.targeted?(c), "c is not targeted")
-
-        # Now trigger our three resources
-        assert_nothing_raised do
-            assert_nil(trans.trigger(a), "a somehow triggered something")
-        end
-        assert_nothing_raised do
-            assert_nil(trans.trigger(b), "b somehow triggered something")
-        end
-        assert_equal([], $triggered,"got something in triggered")
-        result = nil
-        assert_nothing_raised do
-            result = trans.trigger(c)
-        end
-        assert(result, "c did not trigger anything")
-        assert_instance_of(Array, result)
-        event = result.shift
-        assert_instance_of(Puppet::Transaction::Event, event)
-        assert_equal(:triggered, event.name, "event was not set correctly")
-        assert_equal(c, event.source, "source was not set correctly")
-
-        assert(trans.triggered?(c, :refresh),
-            "Transaction did not store the trigger")
-    end
-
-    def test_set_target
-        file = Puppet::Type.type(:file).new(:path => tempfile(), :content => "yay")
-        exec1 = Puppet::Type.type(:exec).new :command => "/bin/echo exec1"
-        exec2 = Puppet::Type.type(:exec).new :command => "/bin/echo exec2"
-        trans = Puppet::Transaction.new(mk_catalog(file, exec1, exec2))
-
-        # First try it with an edge that has no callback
-        edge = Puppet::Relationship.new(file, exec1)
-        assert_nothing_raised { trans.set_trigger(edge) }
-        assert(! trans.targeted?(exec1), "edge with no callback resulted in a target")
-
-        # Now with an edge that has an unsupported callback
-        edge = Puppet::Relationship.new(file, exec1, :callback => :nosuchmethod, :event => :ALL_EVENTS)
-        assert_nothing_raised { trans.set_trigger(edge) }
-        assert(! trans.targeted?(exec1), "edge with invalid callback resulted in a target")
-
-        # Lastly, with an edge with a supported callback
-        edge = Puppet::Relationship.new(file, exec1, :callback => :refresh, :event => :ALL_EVENTS)
-        assert_nothing_raised { trans.set_trigger(edge) }
-        assert(trans.targeted?(exec1), "edge with valid callback did not result in a target")
-    end
-
     # Testing #401 -- transactions are calling refresh() on classes that don't support it.
     def test_callback_availability
         $called = []

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list