test/helper.rb in turn-0.9.0 vs test/helper.rb in turn-0.9.1
- old
+ new
@@ -15,18 +15,27 @@
#
#Turn.config.format = :pretty
#
def turn(*args)
- `ruby -Ilib bin/turn -Ilib #{args.join(' ')} 2>&1`
+ if RUBY_VERSION < '1.9'
+ `ruby1.8 -Ilib bin/turn -Ilib #{args.join(' ')} 2>&1`
+ else
+ `ruby -Ilib bin/turn -Ilib #{args.join(' ')} 2>&1`
+ end
end
#
def turn2(*args)
- `ruby -Ilib bin/turn -Ilib #{args.join(' ')}`
+ if RUBY_VERSION < '1.9'
+ `ruby1.8 -Ilib bin/turn -Ilib #{args.join(' ')}`
+ else
+ `ruby -Ilib bin/turn -Ilib #{args.join(' ')}`
+ end
end
+#
def turn_with_term(term, *args)
`TERM="#{term}" ruby -Ilib bin/turn -Ilib #{args.join(' ')} 2>&1`
end
#
@@ -42,10 +51,24 @@
#name = name + '_required' if requires
save_test(text, name)
end
#
+def setup_testunit(required=false, name=nil)
+ text = ''
+ text << "require '#{required}'\n" if required
+ text << <<-HERE
+class TestTest < Test::Unit::TestCase
+#{standard_test_body}
+end
+ HERE
+ #name = framwwork.downcase
+ #name = name + '_required' if requires
+ save_test(text, name)
+end
+
+#
def save_test(text, name=nil)
file = File.join('tmp', name || 'test.rb')
FileUtils.mkdir_p('tmp') unless File.directory?('tmp')
File.open(file, 'w'){ |f| f << text }
return file
@@ -76,10 +99,10 @@
end
HERE
end
#
-def setup_outline_test
+def setup_testunit_outline
text = <<-HERE
class OutlineTest < Test::Unit::TestCase
def test_sample_pass
puts "You should not see me"
assert_equal(1,1)