From 65b72676aef2d58314f546eb31780d1b9925b9b3 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Fri, 29 Feb 2008 12:04:42 -0600 Subject: Fixing the fact that resources that model defined resources were getting finished multiple times, which meant they got multiple copies of metaparams. --- spec/unit/parser/resource.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec') diff --git a/spec/unit/parser/resource.rb b/spec/unit/parser/resource.rb index 035590341..9ce7b391b 100755 --- a/spec/unit/parser/resource.rb +++ b/spec/unit/parser/resource.rb @@ -67,6 +67,12 @@ describe Puppet::Parser::Resource do @resource = Puppet::Parser::Resource.new(:type => "mydefine", :title => "whatever", :scope => @scope, :source => @source) end + it "should do nothing if it has already been finished" do + @resource.finish + @resource.expects(:add_metaparams).never + @resource.finish + end + it "should copy metaparams from its scope" do @scope.setvar("noop", "true") -- cgit From e008b02ae04594bd53a9aa29c24961a7d9d9763d Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Fri, 29 Feb 2008 12:56:02 -0600 Subject: Fixing #1110 -- transactions now always make sure their tags are arrays. --- spec/unit/other/transaction.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'spec') diff --git a/spec/unit/other/transaction.rb b/spec/unit/other/transaction.rb index e277a24c0..0db470d26 100755 --- a/spec/unit/other/transaction.rb +++ b/spec/unit/other/transaction.rb @@ -25,4 +25,9 @@ describe Puppet::Transaction, " when determining tags" do @transaction.tags = %w{one two} @transaction.tags.should == %w{one two} end + + it "should always convert assigned tags to an array" do + @transaction.tags = "one::two" + @transaction.tags.should == %w{one::two} + end end -- cgit