test/helper.rb in turn-0.8.3 vs test/helper.rb in turn-0.9.0
- old
+ new
@@ -1,16 +1,23 @@
+$:.unshift './lib'
+
+#require 'turn/colorize'
require 'fileutils'
if RUBY_VERSION < "1.9"
require 'test/unit'
else
require 'minitest/unit'
require 'test/unit'
end
+require 'turn'
#
+#Turn.config.format = :pretty
+
+#
def turn(*args)
`ruby -Ilib bin/turn -Ilib #{args.join(' ')} 2>&1`
end
#
@@ -37,11 +44,11 @@
end
#
def save_test(text, name=nil)
file = File.join('tmp', name || 'test.rb')
- FileUtils.mkdir_p('tmp')
+ FileUtils.mkdir_p('tmp') unless File.directory?('tmp')
File.open(file, 'w'){ |f| f << text }
return file
end
#
@@ -89,10 +96,11 @@
#
def setup_minitest_autorun
text = <<-HERE
require 'turn'
+MiniTest::Unit.runner = Turn::MiniRunner.new
MiniTest::Unit.autorun
#require 'minitest/unit'
class TestTest < MiniTest::Unit::TestCase
def test_sample_pass
assert_equal(1,1)
@@ -106,12 +114,13 @@
def setup_minitest_autorun_with_trace
text = <<-HERE
#require 'minitest/unit'
#require 'rubygems'
require 'turn'
+MiniTest::Unit.runner = Turn::MiniRunner.new
MiniTest::Unit.autorun
Turn.config do |c|
- c.trace = true
+ c.trace = 1
end
class TestTest < MiniTest::Unit::TestCase
def test_sample_pass
assert_equal(0,1)
end