summaryrefslogtreecommitdiffstats
path: root/spec/lib
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-05-31 15:02:41 -0700
committerDaniel Pittman <daniel@puppetlabs.com>2011-05-31 15:26:41 -0700
commit618495c7b70671ff1da1653c76d1524ff3f615b7 (patch)
treee08c7ad4473a158e366625fcd56ad145522e7369 /spec/lib
parent0d9eaea6fafe6bf57731a115d6a41c7ceacd8057 (diff)
downloadpuppet-618495c7b70671ff1da1653c76d1524ff3f615b7.tar.gz
puppet-618495c7b70671ff1da1653c76d1524ff3f615b7.tar.xz
puppet-618495c7b70671ff1da1653c76d1524ff3f615b7.zip
#7211: more helpful error messages in various cases.
We were emitting a bunch of unhelpful failure messages, surrounding invalid actions and especially default actions interacting with the command-line. This cleans those up, to give a helpful, informative, and correct message in all cases. Notably, we no longer report that there is no "default" action when you specify an unknown action on a face. This change revealed some other weaknesses in our unit tests, now correctly, that result in slightly more robust code.
Diffstat (limited to 'spec/lib')
-rwxr-xr-xspec/lib/puppet/face/basetest.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/lib/puppet/face/basetest.rb b/spec/lib/puppet/face/basetest.rb
index 9398f5b2d..e5c9a9dc5 100755
--- a/spec/lib/puppet/face/basetest.rb
+++ b/spec/lib/puppet/face/basetest.rb
@@ -38,4 +38,9 @@ Puppet::Face.define(:basetest, '0.0.1') do
when_invoked do |options| "this is not the hook you are looking for" end
when_rendering :s do |value| "you invoked the 's' rendering hook" end
end
+
+ action :count_args do
+ summary "return the count of arguments given"
+ when_invoked do |*args| args.length - 1 end
+ end
end