Bug #1016

Raises LocalJump exception in MiniTest::Unit.autorun.

Added by Kouji Takao over 6 years ago. Updated almost 4 years ago.

[ruby-core:21364]
Status:Closed
Priority:Low
Assignee:-
ruby -v:ruby 1.9.1p5000 (2009-01-31 trunk 21924) [i386-darwin9.6.0] Backport:

Description

=begin
Hi Ryan,

If $! is not nil, returns in the block of the at_exit method in
MiniTest::Unit.autorun. Then raises LocalJump exception.


def self.autorun
at_exit {
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
@@installed_at_exit = true
end


The attached patch will fix the problem.

Index: lib/minitest/unit.rb
===================================================================
--- lib/minitest/unit.rb (revision 21508)
+++ lib/minitest/unit.rb (working copy)
@@ -325,7 +325,7 @@

  def self.autorun
    at_exit {
  • return if $! # don't run if there was an exception
  • next 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

Thanks, kouji.
=end

History

#1 Updated by Ryan Davis over 6 years ago

=begin

On Jan 15, 2009, at 02:29 , Takao Kouji wrote:

If $! is not nil, returns in the block of the at_exit method in
MiniTest::Unit.autorun. Then raises LocalJump exception.

doh! fixed. thanks.

=end

#2 Updated by Kouji Takao about 6 years ago

  • Category set to lib
  • Status changed from Open to Closed
  • Target version set to 2.0.0
  • ruby -v set to ruby 1.9.1p5000 (2009-01-31 trunk 21924) [i386-darwin9.6.0]

=begin
closed.
=end

Also available in: Atom PDF