summaryrefslogtreecommitdiffstats
path: root/lib/puppet/interface/action.rb
diff options
context:
space:
mode:
authorMatt Robinson <matt@puppetlabs.com>2011-05-16 16:53:28 -0700
committerMatt Robinson <matt@puppetlabs.com>2011-05-17 09:56:14 -0700
commit47e4ac948504aa6fbd3487ca1b1e19f3c8884a79 (patch)
tree8888b2ef0e76f21e77ccd5cc17b491a114cc3175 /lib/puppet/interface/action.rb
parent8f58db9188359ab8c8988e56b1abf0ec3bbc1303 (diff)
downloadpuppet-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.rb2
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 = {}"