+1 On Oct 19, 2009, at 8:22 PM, Markus Roberts wrote:
> > 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 <[email protected]> > --- > lib/puppet/resource/catalog.rb | 7 ++++++- > spec/unit/resource/catalog.rb | 12 ++++++++---- > 2 files changed, 14 insertions(+), 5 deletions(-) > > diff --git a/lib/puppet/resource/catalog.rb b/lib/puppet/resource/ > catalog.rb > index 8ab788e..5bf9a83 100644 > --- a/lib/puppet/resource/catalog.rb > +++ b/lib/puppet/resource/catalog.rb > @@ -418,6 +418,10 @@ class Puppet::Resource::Catalog < > Puppet::SimpleGraph > end > end > > + if classes = data['classes'] > + result.add_class(*classes) > + end > + > result > end > > @@ -452,7 +456,8 @@ class Puppet::Resource::Catalog < > Puppet::SimpleGraph > 'name' => name, > 'version' => version, > 'resources' => vertices.collect { |v| > v.to_pson_data_hash }, > - 'edges' => edges. collect { |e| > e.to_pson_data_hash } > + 'edges' => edges. collect { |e| > e.to_pson_data_hash }, > + 'classes' => classes > }, > 'metadata' => { > 'api_version' => 1 > diff --git a/spec/unit/resource/catalog.rb b/spec/unit/resource/ > catalog.rb > index 39f185a..db67243 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 > -- > 1.6.4 > > > > -- The Ninety-Ninety Rule of Project Schedules: The first 90% of the task takes 90% of the time, and the last 10% takes the other 90%. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en -~----------~----~----~----~------~----~------~--~---
