diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | lib/test/unit.rb | 8 |
2 files changed, 11 insertions, 1 deletions
@@ -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=) |