summaryrefslogtreecommitdiffstats
path: root/spec/integration/parser/functions_spec.rb
Commit message (Collapse)AuthorAgeFilesLines
* Remove order dependency from functions integration specJacob Helwig2011-06-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* maint: clean up the spec test headers in bulk.Daniel Pittman2011-04-131-2/+1
| | | | | | | We now use a shebang of: #!/usr/bin/env rspec This enables the direct execution of spec tests again, which was lost earlier during the transition to more directly using the rspec2 runtime environment.
* maint: just require 'spec_helper', thanks rspec2Daniel Pittman2011-04-081-2/+2
| | | | | | | | | | | rspec2 automatically sets a bunch of load-path stuff we were by hand, so we can just stop. As a side-effect we can now avoid a whole pile of stupid things to try and include the spec_helper.rb file... ...and then we can stop protecting spec_helper from evaluating twice, since we now require it with a consistent name. Yay. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
* maint: Use expand_path when requiring spec_helper or puppettestMatt Robinson2010-12-061-1/+1
| | | | | | | | | Doing a require to a relative path can cause files to be required more than once when they're required from different relative paths. If you expand the path fully, this won't happen. Ruby 1.9 also requires that you use expand_path when doing these requires. Paired-with: Jesse Wolfe
* Fix #4921 - race condition in Parser Functions creationBrice Figureau2010-11-121-0/+21
The autoloading is not thread safe, which means two threads could both autoload the same function at the same time. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>