summaryrefslogtreecommitdiff
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
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
-rw-r--r--ChangeLog7
-rw-r--r--lib/test/unit.rb6
-rw-r--r--test/testunit/test_rake_integration.rb30
3 files changed, 41 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0139fabaf2..5ebbedf95b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Sat Feb 19 06:36:27 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * 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.
+
Fri Feb 18 19:31:31 2011 Shugo Maeda <shugo@ruby-lang.org>
* lib/fileutils.rb (FileUtils::remove_entry_secure): there is a
diff --git a/lib/test/unit.rb b/lib/test/unit.rb
index fd50d8100d..76e9fddf95 100644
--- a/lib/test/unit.rb
+++ b/lib/test/unit.rb
@@ -186,8 +186,6 @@ module Test
end
class Runner < MiniTest::Unit
- include Test::Unit::Options
- include Test::Unit::RequireFiles
include Test::Unit::GlobOption
include Test::Unit::LoadPathOption
include Test::Unit::GCStressOption
@@ -225,6 +223,10 @@ module Test
end
class AutoRunner
+ class Runner < Test::Unit::Runner
+ include Test::Unit::RequireFiles
+ end
+
attr_accessor :to_run, :options
def initialize(force_standalone = false, default_dir = nil, argv = ARGV)
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