test/helper.rb in turn-0.8.2 vs test/helper.rb in turn-0.8.3
- old
+ new
@@ -2,22 +2,28 @@
if RUBY_VERSION < "1.9"
require 'test/unit'
else
require 'minitest/unit'
+ require 'test/unit'
end
+
#
def turn(*args)
`ruby -Ilib bin/turn -Ilib #{args.join(' ')} 2>&1`
end
#
def turn2(*args)
`ruby -Ilib bin/turn -Ilib #{args.join(' ')}`
end
+def turn_with_term(term, *args)
+ `TERM="#{term}" ruby -Ilib bin/turn -Ilib #{args.join(' ')} 2>&1`
+end
+
#
def setup_test(framework, required=false, name=nil)
text = ''
text << "require '#{required}'\n" if required
text << <<-HERE
@@ -82,16 +88,35 @@
end
#
def setup_minitest_autorun
text = <<-HERE
-require 'minitest/unit'
+require 'turn'
MiniTest::Unit.autorun
+#require 'minitest/unit'
class TestTest < MiniTest::Unit::TestCase
def test_sample_pass
assert_equal(1,1)
end
end
HERE
save_test(text, 'minitest_autorun_test.rb')
end
+
+def setup_minitest_autorun_with_trace
+ text = <<-HERE
+#require 'minitest/unit'
+#require 'rubygems'
+require 'turn'
+MiniTest::Unit.autorun
+Turn.config do |c|
+ c.trace = true
+end
+class TestTest < MiniTest::Unit::TestCase
+ def test_sample_pass
+ assert_equal(0,1)
+ end
+end
+ HERE
+ save_test(text, 'minitest_autorun_test_with_fail.rb')
+end