summaryrefslogtreecommitdiffstats
path: root/spec/integration/parser/functions
diff options
context:
space:
mode:
authorBrice Figureau <brice-puppet@daysofwonder.com>2010-03-21 12:07:37 +0100
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commit73c8d0d4701f10995c81633b912bc6dc65a2cf78 (patch)
tree7ebdb31406b4f85e55e621e4cfde356d0ca7ed9b /spec/integration/parser/functions
parentc5a4de28532eaaf8abf2496ca1d4cdc02e5f450a (diff)
downloadpuppet-73c8d0d4701f10995c81633b912bc6dc65a2cf78.tar.gz
puppet-73c8d0d4701f10995c81633b912bc6dc65a2cf78.tar.xz
puppet-73c8d0d4701f10995c81633b912bc6dc65a2cf78.zip
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 <brice-puppet@daysofwonder.com>
Diffstat (limited to 'spec/integration/parser/functions')
-rwxr-xr-xspec/integration/parser/functions/require.rb19
1 files changed, 18 insertions, 1 deletions
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