diff options
author | Jacob Helwig <jacob@puppetlabs.com> | 2011-06-17 11:23:21 -0700 |
---|---|---|
committer | Jacob Helwig <jacob@puppetlabs.com> | 2011-06-28 15:29:02 -0700 |
commit | 014d952883246f8919d4b1935d84b301c63a34d0 (patch) | |
tree | 6e650863a92dd14d84c5b6f4b9d917fbc87db15d /spec/integration/parser/functions_spec.rb | |
parent | 534ccfe8d8cac382f91eea1047bca2b183e937ca (diff) | |
download | puppet-014d952883246f8919d4b1935d84b301c63a34d0.tar.gz puppet-014d952883246f8919d4b1935d84b301c63a34d0.tar.xz puppet-014d952883246f8919d4b1935d84b301c63a34d0.zip |
Remove order dependency from functions integration spec
The test in spec/integration/parser/functions_spec.rb would fail when
the spec tests were run in the order (among other orderings):
spec/unit/parser/functions/tag_spec.rb
spec/unit/parser/templatewrapper_spec.rb
spec/integration/parser/functions_spec.rb
There are tests that would cause the "template" function to be loaded
into the root environment.
Puppet::Parser::Functions.function("template") would then detect its
presence and P::P::F.rmfunction("template") would fail since #function(...)
looks in more than just the current environment to see if a function
is defined, while #rmfunction(...) only looks in the current
environment to see if a function can be removed.
In the test ordering specified earlier, tag_spec.rb would load the
"template" function, and templatewrapper_spec.rb would create a
current environment that would mask the root environment for #rmfunction(...),
but not for #function(...)
Since #rmfunction(...) only looks in the current environment, we
should be using #functions.include?("template") since that matches the
check that #rmfunction(...) itself uses.
Paired-with: Nick Lewis <nick@puppetlabs.com>
Diffstat (limited to 'spec/integration/parser/functions_spec.rb')
-rwxr-xr-x | spec/integration/parser/functions_spec.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/integration/parser/functions_spec.rb b/spec/integration/parser/functions_spec.rb index 6791987d7..6a8fbca9c 100755 --- a/spec/integration/parser/functions_spec.rb +++ b/spec/integration/parser/functions_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Puppet::Parser::Functions do before :each do - Puppet::Parser::Functions.rmfunction("template") if Puppet::Parser::Functions.function("template") + Puppet::Parser::Functions.rmfunction("template") if Puppet::Parser::Functions.functions.include?("template") end it "should support multiple threads autoloading the same function" do |