From 73c8d0d4701f10995c81633b912bc6dc65a2cf78 Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Sun, 21 Mar 2010 12:07:37 +0100 Subject: Fix #3186 - require function set relationship only on the last class Due to the fact that resource.set_parameter is overwriting the previous set_parameters, we were losing the previous relationships we set there, either in a previous call of require or in the same call. Signed-off-by: Brice Figureau --- spec/integration/parser/functions/require.rb | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'spec/integration/parser') diff --git a/spec/integration/parser/functions/require.rb b/spec/integration/parser/functions/require.rb index 960594b21..6f169ade1 100755 --- a/spec/integration/parser/functions/require.rb +++ b/spec/integration/parser/functions/require.rb @@ -22,10 +22,27 @@ describe "the require function" do @scope.function_require("requiredclass") @scope.resource["require"].should_not be_nil - ref = @scope.resource["require"] + ref = @scope.resource["require"].shift ref.type.should == "Class" ref.title.should == "requiredclass" end + + it "should queue relationships between the 'required' class and our classes" do + @parser.newclass("requiredclass1") + @parser.newclass("requiredclass2") + + @scope.function_require("requiredclass1") + @scope.function_require("requiredclass2") + + @scope.resource["require"].should_not be_nil + + (ref1,ref2) = @scope.resource["require"] + ref1.type.should == "Class" + ref1.title.should == "requiredclass1" + ref2.type.should == "Class" + ref2.title.should == "requiredclass2" + end + end describe "the include function" do -- cgit