summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
authorMarkus Roberts <Markus@reality.com>2009-10-19 09:25:55 -0700
committerMarkus Roberts <Markus@reality.com>2009-10-19 20:20:31 -0700
commitae528f62e898fac37ea7d37c6fcff2e5c0954782 (patch)
treedf1f2249434b194164d6645090dcad17e628daca /spec/unit
parentf59f8054dc0d1c86169b954fab96df650f38dd23 (diff)
downloadpuppet-ae528f62e898fac37ea7d37c6fcff2e5c0954782.tar.gz
puppet-ae528f62e898fac37ea7d37c6fcff2e5c0954782.tar.xz
puppet-ae528f62e898fac37ea7d37c6fcff2e5c0954782.zip
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 <Markus@reality.com>
Diffstat (limited to 'spec/unit')
-rwxr-xr-xspec/unit/resource/catalog.rb12
1 files changed, 8 insertions, 4 deletions
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