[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Daniel Pittman daniel at puppetlabs.com
Tue May 10 08:18:51 UTC 2011


The following commit has been merged in the experimental branch:
commit a71bfa10123276b1dc96c5ef540b9fbf222c2f6d
Merge: 040e0fdaacb767d61ef07a41098ebb9c998738e4 b23cc8abec1a1ec41b554b4e72f9a3c21feaf9da
Author: Daniel Pittman <daniel at puppetlabs.com>
Date:   Mon May 2 10:09:24 2011 -0700

    Merge branch 'bug/2.7.x/7282-fail-when-no-invocation-given-for-action' into 2.7.x

diff --combined spec/unit/interface/action_spec.rb
index ccd7915,e799609..9e539c6
--- a/spec/unit/interface/action_spec.rb
+++ b/spec/unit/interface/action_spec.rb
@@@ -150,6 -150,7 +150,7 @@@ describe Puppet::Interface::Action d
      it "should support options with an empty block" do
        face = Puppet::Interface.new(:action_level_options, '0.0.1') do
          action :foo do
+           when_invoked do true end
            option "--bar" do
              # this line left deliberately blank
            end
@@@ -162,7 -163,10 +163,10 @@@
  
      it "should return only action level options when there are no face options" do
        face = Puppet::Interface.new(:action_level_options, '0.0.1') do
-         action :foo do option "--bar" end
+         action :foo do
+           when_invoked do true end
+           option "--bar"
+         end
        end
  
        face.get_action(:foo).options.should =~ [:bar]
@@@ -171,8 -175,8 +175,8 @@@
      describe "with both face and action options" do
        let :face do
          Puppet::Interface.new(:action_level_options, '0.0.1') do
-           action :foo do option "--bar" end
-           action :baz do option "--bim" end
+           action :foo do when_invoked do true end ; option "--bar" end
+           action :baz do when_invoked do true end ; option "--bim" end
            option "--quux"
          end
        end
@@@ -186,7 -190,10 +190,10 @@@
          parent.option "--foo"
          child = parent.new(:inherited_options, '0.0.1') do
            option "--bar"
-           action :action do option "--baz" end
+           action :action do
+             when_invoked do true end
+             option "--baz"
+           end
          end
  
          action = child.get_action(:action)
@@@ -215,7 -222,10 +222,10 @@@
      it_should_behave_like "things that declare options" do
        def add_options_to(&block)
          face = Puppet::Interface.new(:with_options, '0.0.1') do
-           action(:foo, &block)
+           action(:foo) do
+             when_invoked do true end
+             self.instance_eval &block
+           end
          end
          face.get_action(:foo)
        end
@@@ -350,7 -360,7 +360,7 @@@
              option("-q", "--action-quux") { after_action { |_,_,_| report :action_quux } }
              option("-a")                  { after_action { |_,_,_| report :a           } }
              option("--action-baz")        { after_action { |_,_,_| report :action_baz  } }
 -            when_invoked { |options| warn options.inspect }
 +            when_invoked { }
            end
            option("-u", "--face-quux") { after_action { |_,_,_| report :face_quux } }
            option("-f")                { after_action { |_,_,_| report :f         } }
@@@ -498,7 -508,9 +508,9 @@@
    it_should_behave_like "documentation on faces" do
      subject do
        face = Puppet::Interface.new(:action_documentation, '0.0.1') do
-         action :documentation do end
+         action :documentation do
+           when_invoked do true end
+         end
        end
        face.get_action(:documentation)
      end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list