summaryrefslogtreecommitdiff
path: root/test/testunit
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-18 21:39:09 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-18 21:39:09 +0000
commitc36abbfd436b26fa7c92feade7d78d276e42d5ee (patch)
tree65e505b21d08a2e9f0a947ec2249cf61b35da923 /test/testunit
parentc1afbd39e1769d705dcbf08482f91c1e6c939e8f (diff)
* lib/test/unit.rb: partial revert of r30849. [ruby-core:32864]
* test/testunit/test_rake_integration.rb: adding an integration test with the rake loader to prevent regressions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/testunit')
-rw-r--r--test/testunit/test_rake_integration.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/testunit/test_rake_integration.rb b/test/testunit/test_rake_integration.rb
new file mode 100644
index 0000000000..bb0951d534
--- /dev/null
+++ b/test/testunit/test_rake_integration.rb
@@ -0,0 +1,30 @@
+require 'minitest/autorun'
+require 'tmpdir'
+require_relative '../ruby/envutil'
+
+class RakeIntegration < MiniTest::Unit::TestCase
+ include Test::Unit::Assertions
+ RAKE_LOADER = File.expand_path(
+ File.join(
+ File.dirname(__FILE__),
+ '..',
+ '..',
+ 'lib',
+ 'rake',
+ 'rake_test_loader.rb'))
+
+ def test_with_rake_runner
+ Dir.mktmpdir do |dir|
+ filename = File.join dir, 'testing.rb'
+ File.open(filename, 'wb') do |f|
+ f.write <<-eotest
+require 'test/unit'
+raise 'loaded twice' if defined?(FooTest)
+class FooTest; end
+ eotest
+ end
+
+ assert_ruby_status(%w{ -w } + [RAKE_LOADER, filename])
+ end
+ end
+end