From 424b56da616041e365cb471dafc05a3d7ade4e45 Mon Sep 17 00:00:00 2001 From: Patrick Carlisle Date: Thu, 9 Aug 2012 14:33:10 -0700 Subject: Make sure functions are loaded for each test 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. --- spec/unit/puppet/parser/functions/validate_absolute_path_spec.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'spec/unit/puppet/parser/functions/validate_absolute_path_spec.rb') diff --git a/spec/unit/puppet/parser/functions/validate_absolute_path_spec.rb b/spec/unit/puppet/parser/functions/validate_absolute_path_spec.rb index 9d66fcb..08aaf78 100644 --- a/spec/unit/puppet/parser/functions/validate_absolute_path_spec.rb +++ b/spec/unit/puppet/parser/functions/validate_absolute_path_spec.rb @@ -3,8 +3,12 @@ require 'spec_helper' 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 -- cgit v1.2.3