summaryrefslogtreecommitdiffstats
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-05-24 14:13:02 -0500
committerJames Turnbull <james@ubuntu904.lovedthanlost.net>2009-05-26 13:43:39 +1000
commit6e824d8ca58c5d6f27a4cfcf44fad579a24133d4 (patch)
tree1678ac69287628323ea67457461463a2e0b0ea40 /spec/spec_helper.rb
parent1d69dbfd0351d3f4d23c15904061d98f8bf42ca6 (diff)
downloadpuppet-6e824d8ca58c5d6f27a4cfcf44fad579a24133d4.tar.gz
puppet-6e824d8ca58c5d6f27a4cfcf44fad579a24133d4.tar.xz
puppet-6e824d8ca58c5d6f27a4cfcf44fad579a24133d4.zip
Adding a Spec lib directory and moving tmpfile to it
We had a common pattern for creating a temporary file during integration tests, and this just makes that common pattern explicit by moving it to a module in the newly-created lib directory in the spec directory. We definitely don't want to go overboard in using libraries in our tests, but sometimes it gets a bit excessive to completely avoid them. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 2f47d4f50..5c7b6ee86 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,6 +1,7 @@
dir = File.expand_path(File.dirname(__FILE__))
$LOAD_PATH.unshift("#{dir}/")
+$LOAD_PATH.unshift("#{dir}/lib") # a spec-specific test lib dir
$LOAD_PATH.unshift("#{dir}/../lib")
$LOAD_PATH.unshift("#{dir}/../test/lib") # Add the old test dir, so that we can still find our local mocha and spec
@@ -20,6 +21,10 @@ require 'mocha'
gem 'rspec', '=1.2.2'
require 'spec/autorun'
+# So everyone else doesn't have to include this base constant.
+module PuppetSpec
+end
+
# load any monkey-patches
Dir["#{dir}/monkey_patches/*.rb"].map { |file| require file }