diff options
| author | Luke Kanies <luke@puppetlabs.com> | 2011-07-15 11:21:24 -0700 |
|---|---|---|
| committer | Luke Kanies <luke@puppetlabs.com> | 2011-07-15 11:21:24 -0700 |
| commit | 4ad404ee7e7244d94ff4d87effc1a041d65b3f73 (patch) | |
| tree | 19c3c9a4126df7f29fe771e44252475c6643fd10 /spec/unit/node | |
| parent | b1526216d1e47726bae78a884a0db2666101e34a (diff) | |
| parent | 361220166525762634dd1886f84c9a928b28766b (diff) | |
Merge branch 'tickets/master/7080-serializable_indirector_requests'
Diffstat (limited to 'spec/unit/node')
| -rwxr-xr-x | spec/unit/node/facts_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/unit/node/facts_spec.rb b/spec/unit/node/facts_spec.rb index efaa76e12..6d2b0a7ac 100755 --- a/spec/unit/node/facts_spec.rb +++ b/spec/unit/node/facts_spec.rb @@ -128,6 +128,20 @@ describe Puppet::Node::Facts, "when indirecting" do result['timestamp'].should == facts.timestamp.to_s result['expiration'].should == facts.expiration.to_s end + + it "should not include nil values" do + facts = Puppet::Node::Facts.new("foo", {'a' => 1, 'b' => 2, 'c' => 3}) + pson = PSON.parse(facts.to_pson) + pson.should_not be_include("expiration") + end + + it "should be able to handle nil values" do + pson = %Q({"name": "foo", "values": {"a": "1", "b": "2", "c": "3"}}) + format = Puppet::Network::FormatHandler.format('pson') + facts = format.intern(Puppet::Node::Facts,pson) + facts.name.should == 'foo' + facts.expiration.should be_nil + end end end end |
