diff options
author | Matt Robinson <matt@puppetlabs.com> | 2011-05-16 16:53:28 -0700 |
---|---|---|
committer | Matt Robinson <matt@puppetlabs.com> | 2011-05-17 09:56:14 -0700 |
commit | 47e4ac948504aa6fbd3487ca1b1e19f3c8884a79 (patch) | |
tree | 8888b2ef0e76f21e77ccd5cc17b491a114cc3175 /lib/puppet/interface/action.rb | |
parent | 8f58db9188359ab8c8988e56b1abf0ec3bbc1303 (diff) | |
download | puppet-47e4ac948504aa6fbd3487ca1b1e19f3c8884a79.tar.gz puppet-47e4ac948504aa6fbd3487ca1b1e19f3c8884a79.tar.xz puppet-47e4ac948504aa6fbd3487ca1b1e19f3c8884a79.zip |
(#7507) Fix when_invoked action specs in Ruby 1.9
Ruby 1.9 is strict about argument arity for methods that are
metaprogrammatically defined. A ton of specs that were setting up
when_invoked didn't pass options even though they should have been.
Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
Diffstat (limited to 'lib/puppet/interface/action.rb')
-rw-r--r-- | lib/puppet/interface/action.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/puppet/interface/action.rb b/lib/puppet/interface/action.rb index 622371a4e..3c377a49f 100644 --- a/lib/puppet/interface/action.rb +++ b/lib/puppet/interface/action.rb @@ -192,7 +192,7 @@ class Puppet::Interface::Action # but will on 1.9.2, which treats it as "no arguments". Which bites, # because this just begs for us to wind up in the horrible situation # where a 1.8 vs 1.9 error bites our end users. --daniel 2011-04-19 - raise ArgumentError, "action when_invoked requires at least one argument (options)" + raise ArgumentError, "when_invoked requires at least one argument (options) for action #{@name}" elsif arity > 0 then range = Range.new(1, arity - 1) decl = range.map { |x| "arg#{x}" } << "options = {}" |