diff options
author | Jesse Wolfe <jes5199@gmail.com> | 2010-07-01 15:19:32 -0700 |
---|---|---|
committer | Markus Roberts <Markus@reality.com> | 2010-07-02 12:31:52 -0700 |
commit | e579aab5529f080d88aed35656b66d80a2065a64 (patch) | |
tree | 1319e94b5b85047bcdcff7eef26a8f235e3a8f87 | |
parent | 298a76401544422b4e0beeddc95542e21d48690e (diff) | |
download | puppet-e579aab5529f080d88aed35656b66d80a2065a64.tar.gz puppet-e579aab5529f080d88aed35656b66d80a2065a64.tar.xz puppet-e579aab5529f080d88aed35656b66d80a2065a64.zip |
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
-rw-r--r-- | spec/spec_helper.rb | 16 |
1 files 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. |