ruby-changes:18888
From: tenderlove <ko1@a...>
Date: Sat, 19 Feb 2011 06:43:40 +0900 (JST)
Subject: [ruby-changes:18888] Ruby:r30913 (trunk): * lib/test/unit.rb: partial revert of r30849.
tenderlove 2011-02-19 06:39:09 +0900 (Sat, 19 Feb 2011) New Revision: 30913 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30913 Log: * 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. Added files: trunk/test/testunit/test_rake_integration.rb Modified files: trunk/ChangeLog trunk/lib/test/unit.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 30912) +++ ChangeLog (revision 30913) @@ -1,3 +1,10 @@ +Sat Feb 19 06:36:27 2011 Aaron Patterson <aaron@t...> + + * 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@r...> * lib/fileutils.rb (FileUtils::remove_entry_secure): there is a Index: lib/test/unit.rb =================================================================== --- lib/test/unit.rb (revision 30912) +++ lib/test/unit.rb (revision 30913) @@ -186,8 +186,6 @@ 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 @@ 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) Index: test/testunit/test_rake_integration.rb =================================================================== --- test/testunit/test_rake_integration.rb (revision 0) +++ test/testunit/test_rake_integration.rb (revision 30913) @@ -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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/