[前][次][番号順一覧][スレッド一覧]

ruby-changes:9174

From: yugui <ko1@a...>
Date: Sat, 13 Dec 2008 10:59:51 +0900 (JST)
Subject: [ruby-changes:9174] Ruby:r20711 (ruby_1_9_1): merges r20686 from trunk into ruby_1_9_1.

yugui	2008-12-13 10:59:33 +0900 (Sat, 13 Dec 2008)

  New Revision: 20711

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20711

  Log:
    merges r20686 from trunk into ruby_1_9_1.
    Imported minitest 1.3.2 r4503.

  Added files:
    branches/ruby_1_9_1/lib/minitest/autorun.rb
  Modified files:
    branches/ruby_1_9_1/ChangeLog
    branches/ruby_1_9_1/lib/minitest/unit.rb
    branches/ruby_1_9_1/test/minitest/test_mini_test.rb

Index: ruby_1_9_1/ChangeLog
===================================================================
--- ruby_1_9_1/ChangeLog	(revision 20710)
+++ ruby_1_9_1/ChangeLog	(revision 20711)
@@ -1,3 +1,9 @@
+Sat Dec 13 09:17:33 2008  Ryan Davis  <ryand-ruby@z...>
+
+	* lib/minitest/*.rb: Imported minitest 1.3.2 r4503.
+	* test/minitest/test_mini_test.rb: ditto.
+	* lib/miniunit/autorun.rb: added (as part of r4503).
+	
 Sat Dec 13 01:10:03 2008  TAKAO Kouji  <kouji@t...>
 
 	* ext/readline/readline.c
Index: ruby_1_9_1/lib/minitest/autorun.rb
===================================================================
--- ruby_1_9_1/lib/minitest/autorun.rb	(revision 0)
+++ ruby_1_9_1/lib/minitest/autorun.rb	(revision 20711)
@@ -0,0 +1,9 @@
+############################################################
+# This file is imported from a different project.
+# DO NOT make modifications in this repo.
+# File a patch instead and assign it to Ryan Davis
+############################################################
+
+require 'minitest/unit'
+
+MiniTest::Unit.autorun
Index: ruby_1_9_1/lib/minitest/unit.rb
===================================================================
--- ruby_1_9_1/lib/minitest/unit.rb	(revision 20710)
+++ ruby_1_9_1/lib/minitest/unit.rb	(revision 20711)
@@ -118,7 +118,7 @@
     def assert_match exp, act, msg = nil
       msg = message(msg) { "Expected #{mu_pp(act)} to match #{mu_pp(exp)}" }
       assert_respond_to act, :"=~"
-      (exp = /#{exp}/) if String === exp && String === act
+      (exp = /#{Regexp.escape(exp)}/) if String === exp && String === act
       assert act =~ exp, msg
     end
 
@@ -313,7 +313,7 @@
   end
 
   class Unit
-    VERSION = "1.3.1"
+    VERSION = "1.3.2"
 
     attr_accessor :report, :failures, :errors, :skips
     attr_accessor :test_count, :assertion_count
@@ -321,16 +321,14 @@
     @@installed_at_exit ||= false
     @@out = $stdout
 
-    def self.disable_autorun
-      @@installed_at_exit = true
-    end
-
     def self.autorun
       at_exit {
+p $!
+        return if $! # don't run if there was an exception
         exit_code = MiniTest::Unit.new.run(ARGV)
         exit false if exit_code && exit_code != 0
       } unless @@installed_at_exit
-      disable_autorun
+      @@installed_at_exit = true
     end
 
     def self.output= stream
Index: ruby_1_9_1/test/minitest/test_mini_test.rb
===================================================================
--- ruby_1_9_1/test/minitest/test_mini_test.rb	(revision 20710)
+++ ruby_1_9_1/test/minitest/test_mini_test.rb	(revision 20711)
@@ -69,9 +69,9 @@
   end
 
   def test_filter_backtrace_all_unit
-    bt = (["./lib/mini/test.rb:165:in `__send__'"] +
+    bt = (["#{MINITEST_BASE_DIR}/test.rb:165:in `__send__'"] +
           BT_MIDDLE +
-          ["./lib/mini/test.rb:29"])
+          ["#{MINITEST_BASE_DIR}/test.rb:29"])
     ex = bt.clone
     fu = MiniTest::filter_backtrace(bt)
     assert_equal ex, fu

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]