summaryrefslogtreecommitdiffstats
path: root/spec/lib/puppet/face
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-05-02 16:27:28 -0700
committerDaniel Pittman <daniel@puppetlabs.com>2011-05-03 16:09:51 -0700
commit18b3584e16515cfc45aeaa8d0913de8e8bcb3e95 (patch)
treea307832a2dc45005cd6cd9f3da3fb4e87cf2d5a8 /spec/lib/puppet/face
parentb3dd34b4d59329746042b23c1736ed432351a123 (diff)
downloadpuppet-18b3584e16515cfc45aeaa8d0913de8e8bcb3e95.tar.gz
puppet-18b3584e16515cfc45aeaa8d0913de8e8bcb3e95.tar.xz
puppet-18b3584e16515cfc45aeaa8d0913de8e8bcb3e95.zip
(#7329) Consistent naming for rendering formats and hooks.
We refer to rendering formats pretty consistently as `json`, `yaml`, `s`, and so forth; unqualified names. On the other hand, we refer to the rendering hooks *mostly* as `to_*`, except the `:for_humans` and `:json` formats. Which is kind of confusing because of the internal inconsistency, and because it doesn't match the public name. Fix the code to resolve both, so the `to_*` format still works, but we mostly expect to use the `*` version, to match public expectation.
Diffstat (limited to 'spec/lib/puppet/face')
-rwxr-xr-xspec/lib/puppet/face/basetest.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/lib/puppet/face/basetest.rb b/spec/lib/puppet/face/basetest.rb
index 41a4ef3f9..9398f5b2d 100755
--- a/spec/lib/puppet/face/basetest.rb
+++ b/spec/lib/puppet/face/basetest.rb
@@ -32,4 +32,10 @@ Puppet::Face.define(:basetest, '0.0.1') do
summary "just raises an exception"
when_invoked do |options| raise ArgumentError, "your failure" end
end
+
+ action :with_s_rendering_hook do
+ summary "has a rendering hook for 's'"
+ 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
end