aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--lib/test/unit.rb8
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 31d804f5e6..29bfefb8e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,6 @@
-Sun Oct 24 14:17:58 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Oct 24 15:16:30 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::Mini#run): abort if interrupted.
* lib/test/unit.rb (Test::Unit::Mini#run_test_suites): show the
result even when interrupted on the way.
diff --git a/lib/test/unit.rb b/lib/test/unit.rb
index f7e7246198..87c9d1b022 100644
--- a/lib/test/unit.rb
+++ b/lib/test/unit.rb
@@ -162,10 +162,18 @@ module Test
@@installed_at_exit = true
end
+ def run(*args)
+ result = super
+ abort if @interrupt
+ result
+ end
+
def run_test_suites(*args)
old_sync = @@out.sync if @@out.respond_to?(:sync=)
+ @interrupt = false
super
rescue Interrupt
+ @interrupt = true
[@test_count, @assertion_count]
ensure
@@out.sync = old_sync if @@out.respond_to?(:sync=)