The test_helper code in Puppet now resets function state between each test.
This patch fixes two spec files where the function was not actually loaded in
the tests, causing them to fail.
describe Puppet::Parser::Functions.function(:validate_absolute_path) do
let(:scope) { PuppetlabsSpec::PuppetInternals.scope }
- # The subject of these examplres is the method itself.
- subject() { scope.method(:function_validate_absolute_path) }
+ # The subject of these examples is the method itself.
+ subject do
+ # This makes sure the function is loaded within each test
+ function_name = Puppet::Parser::Functions.function(:validate_absolute_path)
+ scope.method(function_name)
+ end
describe "Valid Paths" do
def self.valid_paths
# The subject of these examplres is the method itself.
subject do
- scope.method :function_validate_re
+ # This makes sure the function is loaded within each test
+ function_name = Puppet::Parser::Functions.function(:validate_re)
+ scope.method(function_name)
end
context 'Using Puppet::Parser::Scope.new' do