diff options
author | Patrick Carlisle <patrick@puppetlabs.com> | 2012-08-09 14:33:10 -0700 |
---|---|---|
committer | Patrick Carlisle <patrick@puppetlabs.com> | 2012-08-09 14:51:37 -0700 |
commit | 424b56da616041e365cb471dafc05a3d7ade4e45 (patch) | |
tree | d48e512f3b7cfd83b619e8cdcf080003758b2937 /spec/unit/puppet | |
parent | 94c96f80359a2997bc70a1e1918ddfea795d754a (diff) | |
download | puppet-stdlib-424b56da616041e365cb471dafc05a3d7ade4e45.tar.gz puppet-stdlib-424b56da616041e365cb471dafc05a3d7ade4e45.tar.bz2 |
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.
Diffstat (limited to 'spec/unit/puppet')
-rw-r--r-- | spec/unit/puppet/parser/functions/validate_absolute_path_spec.rb | 8 | ||||
-rw-r--r-- | spec/unit/puppet/parser/functions/validate_re_spec.rb | 4 |
2 files changed, 9 insertions, 3 deletions
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 diff --git a/spec/unit/puppet/parser/functions/validate_re_spec.rb b/spec/unit/puppet/parser/functions/validate_re_spec.rb index a07ad47..d189efb 100644 --- a/spec/unit/puppet/parser/functions/validate_re_spec.rb +++ b/spec/unit/puppet/parser/functions/validate_re_spec.rb @@ -5,7 +5,9 @@ describe Puppet::Parser::Functions.function(:validate_re) do # 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 |