summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-05-02 12:46:09 -0700
committerDaniel Pittman <daniel@puppetlabs.com>2011-05-02 15:34:52 -0700
commita4a274b8c7807fdf35199dc20889de599ea912ca (patch)
tree330ab4c33b57d7635bdcbaf5faf62a50f050564f /spec/unit
parenta71bfa10123276b1dc96c5ef540b9fbf222c2f6d (diff)
(#7315) Fix `to_pson` method to render correctly.
Puppet::Status had an outdated implementation of the `to_pson` hook, so would fail to render when asked. Changes to the faces system exposed this, resulting in a backtrace if the user wanted JSON output on the CLI. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
Diffstat (limited to 'spec/unit')
-rwxr-xr-xspec/unit/status_spec.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/unit/status_spec.rb b/spec/unit/status_spec.rb
index 820807638..0c572fd95 100755
--- a/spec/unit/status_spec.rb
+++ b/spec/unit/status_spec.rb
@@ -15,6 +15,10 @@ describe Puppet::Status do
Puppet::Status.new.status.to_pson.should == '{"is_alive":true}'
end
+ it "should render to a pson hash" do
+ PSON::pretty_generate(Puppet::Status.new).should =~ /"is_alive":\s*true/
+ end
+
it "should accept a hash from pson" do
status = Puppet::Status.new( { "is_alive" => false } )
status.status.should == { "is_alive" => false }