Signed-off-by: Luke Kanies <[email protected]>
---
lib/puppet/parser/functions/require.rb | 5 ++++-
spec/unit/parser/functions/require.rb | 6 ++++++
2 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/lib/puppet/parser/functions/require.rb
b/lib/puppet/parser/functions/require.rb
index 3a2032d..d72169a 100644
--- a/lib/puppet/parser/functions/require.rb
+++ b/lib/puppet/parser/functions/require.rb
@@ -27,7 +27,10 @@ Note that this function only works with clients 0.25 and
later, and it will
fail if used with earlier clients.
") do |vals|
- send(:function_include, vals)
+ # Verify that the 'include' function is loaded
+ method = Puppet::Parser::Functions.function(:include)
+
+ send(method, vals)
if resource.metaparam_compatibility_mode?
warning "The 'require' function is only compatible with clients at
0.25 and above; including class but not adding dependency"
else
diff --git a/spec/unit/parser/functions/require.rb
b/spec/unit/parser/functions/require.rb
index 24c9ecc..577a52a 100755
--- a/spec/unit/parser/functions/require.rb
+++ b/spec/unit/parser/functions/require.rb
@@ -31,6 +31,12 @@ describe "the require function" do
@scope.function_require("myclass")
end
+ it "should verify the 'include' function is loaded" do
+
Puppet::Parser::Functions.expects(:function).with(:include).returns(:function_include)
+ @scope.stubs(:function_include)
+ @scope.function_require("myclass")
+ end
+
it "should include the class but not add a dependency if used on a client
not at least version 0.25" do
@resource.expects(:metaparam_compatibility_mode?).returns true
@scope.expects(:warning)
--
1.6.1
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---