From ae528f62e898fac37ea7d37c6fcff2e5c0954782 Mon Sep 17 00:00:00 2001 From: Markus Roberts Date: Mon, 19 Oct 2009 09:25:55 -0700 Subject: Ticket #2734 PSON/JSON not serializing classes of a catalog Now it does, there are tests to prove it, and the related tests for tags and version have been strengthend. Signed-off-by: Markus Roberts --- spec/unit/resource/catalog.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'spec') diff --git a/spec/unit/resource/catalog.rb b/spec/unit/resource/catalog.rb index 39f185a7c..db672438d 100755 --- a/spec/unit/resource/catalog.rb +++ b/spec/unit/resource/catalog.rb @@ -911,7 +911,7 @@ describe Puppet::Resource::Catalog, "when converting to pson" do PSON.parse @catalog.to_pson end - [:name, :version, :tags].each do |param| + [:name, :version, :tags, :classes].each do |param| it "should set its #{param} to the #{param} of the resource" do @catalog.send(param.to_s + "=", "testing") unless @catalog.send(param) @@ -979,16 +979,20 @@ describe Puppet::Resource::Catalog, "when converting from pson" do it "should set the provided version on the catalog if one is set" do @data['version'] = 50 - @catalog.expects(:version=).with(@data['version']) - PSON.parse @pson.to_pson + @catalog.version.should == @data['version'] end it "should set any provided tags on the catalog" do @data['tags'] = %w{one two} - @catalog.expects(:tag).with("one", "two") + PSON.parse @pson.to_pson + @catalog.tags.should == @data['tags'] + end + it "should set any provided classes on the catalog" do + @data['classes'] = %w{one two} PSON.parse @pson.to_pson + @catalog.classes.should == @data['classes'] end it 'should convert the resources list into resources and add each of them' do -- cgit