Patches item #10379, was opened at 2007-04-26 01:34
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1700&aid=10379&group_id=426

>Category: Developer Tools/Libs
Group: v1.9.x
Status: Open
Resolution: None
Priority: 3
Submitted By: Adam Bozanich (abozanich)
Assigned to: Nobody (None)
Summary: Test::Unit::TestCase regression: register methods with arity == -1

Initial Comment:
Test::Unit::TestCase is skipping over methods defined as below.  It looks like procs/blocks with no arguments have an arity of -1

irb(main):001:0> proc { }.arity
=> -1
irb(main):002:0> proc {|| }.arity
=> -1

The patch is a simple copy & paste from the 1.8 sources.

<example>

require 'test/unit'

class Foo
    attr_reader :attrs
    def initialize
        @attrs = Hash.new
        ("A".."Z").each {  |x|  @attrs[x] = x.downcase }
    end
end

tclass = Class.new( Test::Unit::TestCase )
Foo.const_set "TestAttr" , tclass

Foo.new.attrs.each_pair do |key,value|
    tclass.class_eval do
        define_method("test_#{key}") do
            assert_equal(key,value.upcase)
        end
    end
end

</example>


----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1700&aid=10379&group_id=426