summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-07-25 11:06:58 -0700
committerDaniel Pittman <daniel@puppetlabs.com>2011-07-25 11:06:58 -0700
commitd522b0b824285d025884ff271cda957df1c9951d (patch)
tree8e967424736c6d96e78cda03fc2d7d1d7efe85e8
parent29a25abe7a6e04d2b2f78b604aca3d819f010d38 (diff)
downloadpuppet-d522b0b824285d025884ff271cda957df1c9951d.tar.gz
puppet-d522b0b824285d025884ff271cda957df1c9951d.tar.xz
puppet-d522b0b824285d025884ff271cda957df1c9951d.zip
maint: Fix Face testing bug 1.9.2 revealed.
Ruby 1.8.7 is fairly lax about various bits of introspection, including that we can't tell much about what arguments a block takes. Ruby 1.9.2 makes it possible to do this, though. Meanwhile, the Faces system uses this to make sure that scripts and actions take the right set of arguments, to avoid surprises: failing early and explicitly is better than failing at runtime. Which, in final turn, exposes that I forgot to accept the right arguments in a couple of my testing actions for Faces, but didn't notice because 1.8.7 doesn't check that, and I didn't test on 1.9.2.
-rwxr-xr-xspec/lib/puppet/face/1.0.0/huzzah.rb3
-rwxr-xr-xspec/lib/puppet/face/huzzah.rb3
2 files changed, 2 insertions, 4 deletions
diff --git a/spec/lib/puppet/face/1.0.0/huzzah.rb b/spec/lib/puppet/face/1.0.0/huzzah.rb
index 00f20f096..8a1311704 100755
--- a/spec/lib/puppet/face/1.0.0/huzzah.rb
+++ b/spec/lib/puppet/face/1.0.0/huzzah.rb
@@ -4,6 +4,5 @@ Puppet::Face.define(:huzzah, '1.0.0') do
license "Apache 2 license; see COPYING"
summary "life is a thing for celebration"
script :obsolete_in_core do |_| "you are in obsolete core now!" end
-
- script :call_newer do method_on_newer end
+ script :call_newer do |_| method_on_newer end
end
diff --git a/spec/lib/puppet/face/huzzah.rb b/spec/lib/puppet/face/huzzah.rb
index 47cc3f32c..f3d18a797 100755
--- a/spec/lib/puppet/face/huzzah.rb
+++ b/spec/lib/puppet/face/huzzah.rb
@@ -4,6 +4,5 @@ Puppet::Face.define(:huzzah, '2.0.1') do
license "Apache 2 license; see COPYING"
summary "life is a thing for celebration"
script :bar do |options| "is where beer comes from" end
-
- script :call_older do method_on_older end
+ script :call_older do |_| method_on_older end
end