diff options
Diffstat (limited to 'spec')
| -rwxr-xr-x | spec/unit/application/face_base_spec.rb | 13 | ||||
| -rwxr-xr-x | spec/unit/interface/action_builder_spec.rb | 4 |
2 files changed, 12 insertions, 5 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 diff --git a/spec/unit/interface/action_builder_spec.rb b/spec/unit/interface/action_builder_spec.rb index c122d3eb1..bf7afa74e 100755 --- a/spec/unit/interface/action_builder_spec.rb +++ b/spec/unit/interface/action_builder_spec.rb @@ -151,9 +151,9 @@ describe Puppet::Interface::ActionBuilder do end context "#render_as" do - it "should default to :for_humans" do + it "should default to nil (eg: based on context)" do action = Puppet::Interface::ActionBuilder.build(face, :foo) do end - action.render_as.should == :for_humans + action.render_as.should be_nil end it "should fail if not rendering format is given" do |
