summaryrefslogtreecommitdiffstats
path: root/test/lib
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-09-11 12:38:56 -0500
committerLuke Kanies <luke@madstop.com>2007-09-11 12:38:56 -0500
commit5aa4440b6fb8c9199ee549bd8fe0e4afb296c259 (patch)
tree4b502958da9929e6290993a7bc65e8b8fdc29dd9 /test/lib
parentbb69a1f08a6b0ba37222eeddf28ffbff657283e7 (diff)
downloadpuppet-5aa4440b6fb8c9199ee549bd8fe0e4afb296c259.tar.gz
puppet-5aa4440b6fb8c9199ee549bd8fe0e4afb296c259.tar.xz
puppet-5aa4440b6fb8c9199ee549bd8fe0e4afb296c259.zip
Doing an intermediate commit so rick can look at the work I have done so far.
Diffstat (limited to 'test/lib')
-rwxr-xr-xtest/lib/puppettest.rb16
1 files changed, 10 insertions, 6 deletions
diff --git a/test/lib/puppettest.rb b/test/lib/puppettest.rb
index b56bc563e..45c5b2ed9 100755
--- a/test/lib/puppettest.rb
+++ b/test/lib/puppettest.rb
@@ -5,7 +5,12 @@ $LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), '../../lib
require 'puppet'
require 'mocha'
-require 'test/unit'
+
+# Only load the test/unit class if we're not in the spec directory.
+# Else we get the bogus 'no tests, no failures' message.
+unless Dir.getwd =~ /spec/
+ require 'test/unit'
+end
# Yay; hackish but it works
if ARGV.include?("-d")
@@ -141,7 +146,7 @@ module PuppetTest
end
@configpath = File.join(tmpdir,
- self.class.to_s + "configdir" + @@testcount.to_s + "/"
+ "configdir" + @@testcount.to_s + "/"
)
unless defined? $user and $group
@@ -197,8 +202,7 @@ module PuppetTest
@@tmpfilenum = 1
end
- f = File.join(self.tmpdir(), self.class.to_s + "_" + @method_name.to_s +
- @@tmpfilenum.to_s)
+ f = File.join(self.tmpdir(), "tempfile_" + @@tmpfilenum.to_s)
@@tmpfiles << f
return f
end
@@ -223,11 +227,11 @@ module PuppetTest
when "Darwin": "/private/tmp"
when "SunOS": "/var/tmp"
else
- "/tmp"
+ "/tmp"
end
- @tmpdir = File.join(@tmpdir, "puppettesting")
+ @tmpdir = File.join(@tmpdir, "puppettesting" + Process.pid.to_s)
unless File.exists?(@tmpdir)
FileUtils.mkdir_p(@tmpdir)