summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@rimspace.net>2011-03-02 19:08:24 -0800
committerDaniel Pittman <daniel@rimspace.net>2011-03-03 16:28:35 -0800
commit7c9f1b803d86ead714ff90770e0ccc87ab29efbc (patch)
treeaf4b1b2c19c2f006840c552b7b64528f4f88985d
parentb311651526c7c9448bdd9a77a111302fd0c0efa4 (diff)
downloadpuppet-7c9f1b803d86ead714ff90770e0ccc87ab29efbc.tar.gz
puppet-7c9f1b803d86ead714ff90770e0ccc87ab29efbc.tar.xz
puppet-7c9f1b803d86ead714ff90770e0ccc87ab29efbc.zip
(#6582) order RSpec global :before and :after hooks naturally.
Specifically, reverse the order of the two in spec_helper so that they make more sense; the inverted order was confusing. There are no functional changes, only code movement, in this patchset. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
-rw-r--r--spec/spec_helper.rb34
1 files changed, 17 insertions, 17 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 84ef3f279..feb8928c1 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -30,6 +30,23 @@ require 'monkey_patches/publicize_methods'
RSpec.configure do |config|
config.mock_with :mocha
+ config.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"
+
+ # Avoid opening ports to the outside world
+ Puppet.settings[:bindaddress] = "127.0.0.1"
+
+ @logs = []
+ Puppet::Util::Log.newdestination(Puppet::Test::LogCollector.new(@logs))
+ end
+
config.after :each do
Puppet.settings.clear
Puppet::Node::Environment.clear
@@ -59,23 +76,6 @@ RSpec.configure do |config|
@logs.clear
Puppet::Util::Log.close_all
end
-
- config.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"
-
- # Avoid opening ports to the outside world
- Puppet.settings[:bindaddress] = "127.0.0.1"
-
- @logs = []
- Puppet::Util::Log.newdestination(Puppet::Test::LogCollector.new(@logs))
- end
end
end