diff options
author | Brice Figureau <brice-puppet@daysofwonder.com> | 2008-10-18 12:53:27 +0200 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2008-10-21 21:14:23 +1100 |
commit | ec2b4619d3c90b09e1b9fda0020552d5a2d6061f (patch) | |
tree | c8b11e31644362cbace552214512fffcd61949a9 /spec | |
parent | 356d8cab14ce9600b39b8fdf48beea7c7fbcf345 (diff) | |
download | puppet-ec2b4619d3c90b09e1b9fda0020552d5a2d6061f.tar.gz puppet-ec2b4619d3c90b09e1b9fda0020552d5a2d6061f.tar.xz puppet-ec2b4619d3c90b09e1b9fda0020552d5a2d6061f.zip |
Fix #1115 - part2 - fix tests and add all_tags
Up until this patch, TemplateWrapper.tags was returning all the tags
defined in the catalog. I think this is wrong and tags shoul only
return the defined tags in the current scope.
Hence, I defined a all_tags method that returns the list of tags defined
in the whole catalog.
Diffstat (limited to 'spec')
-rwxr-xr-x | spec/unit/parser/templatewrapper.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/unit/parser/templatewrapper.rb b/spec/unit/parser/templatewrapper.rb index a8c464771..6dbfbe266 100755 --- a/spec/unit/parser/templatewrapper.rb +++ b/spec/unit/parser/templatewrapper.rb @@ -62,10 +62,16 @@ describe Puppet::Parser::TemplateWrapper do tw.classes().should == ["class1", "class2"] end - it "should allow you to retrieve the defined tags with tags" do + it "should allow you to retrieve all the tags with all_tags" do catalog = mock 'catalog', :tags => ["tag1", "tag2"] @scope.expects(:catalog).returns( catalog ) tw = Puppet::Parser::TemplateWrapper.new(@scope, @file) + tw.all_tags().should == ["tag1","tag2"] + end + + it "should allow you to retrieve the tags defined in the current scope" do + @scope.expects(:tags).returns( ["tag1", "tag2"] ) + tw = Puppet::Parser::TemplateWrapper.new(@scope, @file) tw.tags().should == ["tag1","tag2"] end |