summaryrefslogtreecommitdiffstats
path: root/spec/unit/application
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-04-18 17:21:28 -0700
committerDaniel Pittman <daniel@puppetlabs.com>2011-04-19 10:53:46 -0700
commit12098f2d54e8e00a687f42837deeef65c7759389 (patch)
treeb10446af28c549a2befb719f8906dc9aba626987 /spec/unit/application
parent5938452dccc8c925bc6275a62ae96f50916cc239 (diff)
downloadpuppet-12098f2d54e8e00a687f42837deeef65c7759389.tar.gz
puppet-12098f2d54e8e00a687f42837deeef65c7759389.tar.xz
puppet-12098f2d54e8e00a687f42837deeef65c7759389.zip
(#7013) Handle rendering modes out in the application layer.
We no longer establish the rendering mode in the actions; they just default to "nothing", and let that flow on out to the application layer. That lets the facade we put before the face determine the default behaviour. This is mostly a no-op down in the CLI side, but it makes it much easier to integrate into MCollective, HTTP-API, and for other non-CLI users of Faces. Reviewed-By: Max Martin <max@puppetlabs.com>
Diffstat (limited to 'spec/unit/application')
-rwxr-xr-xspec/unit/application/face_base_spec.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/spec/unit/application/face_base_spec.rb b/spec/unit/application/face_base_spec.rb
index 6a4647246..6dfde4367 100755
--- a/spec/unit/application/face_base_spec.rb
+++ b/spec/unit/application/face_base_spec.rb
@@ -211,11 +211,18 @@ describe Puppet::Application::FaceBase do
end
describe "#render" do
- it "should just return a String" do
- app.render("hello").should == "hello"
+ before :each do
+ app.face = Puppet::Face[:basetest, '0.0.1']
+ app.action = app.face.get_action(:foo)
+ end
+
+ ["hello", 1, 1.0].each do |input|
+ it "should just return a #{input.class.name}" do
+ app.render(input).should == input
+ end
end
- [1, 1.000, [1, 2], ["one"], [{ 1 => 1 }]].each do |input|
+ [[1, 2], ["one"], [{ 1 => 1 }]].each do |input|
it "should render #{input.class} using the 'pp' library" do
app.render(input).should == input.pretty_inspect
end