From e579aab5529f080d88aed35656b66d80a2065a64 Mon Sep 17 00:00:00 2001 From: Jesse Wolfe Date: Thu, 1 Jul 2010 15:19:32 -0700 Subject: maint: spec_helper should reset settings directories on *every* test Previously, spec_helper's attempts to set :confdir, and :vardir to /dev/null were getting thwarted by the Settings.clear in after_all --- spec/spec_helper.rb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e1b65e6de..ffc3e9b5c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -66,12 +66,18 @@ Spec::Runner.configure do |config| $tmpfiles.clear end end -end -# Set the confdir and vardir to gibberish so that tests -# have to be correctly mocked. -Puppet[:confdir] = "/dev/null" -Puppet[:vardir] = "/dev/null" + config.prepend_before :each do + # these globals are set by Application + $puppet_application_mode = nil + $puppet_application_name = nil + + # Set the confdir and vardir to gibberish so that tests + # have to be correctly mocked. + Puppet[:confdir] = "/dev/null" + Puppet[:vardir] = "/dev/null" + end +end # We need this because the RAL uses 'should' as a method. This # allows us the same behaviour but with a different method name. -- cgit