From: Adam Bozanich Date: 2007-04-26T15:56:25+09:00 Subject: [patch] Re: test/unit inconsistencies between 1.9 and 1.8 ------=_Part_111218_30734158.1177570581506 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I located the problem, below is a small patch ( copy & paste from 1.8sources ). It appears that a block/proc with no arguments has arity -1. irb(main):001:0> proc { }.arity => -1 irb(main):002:0> proc {|| }.arity => -1 and that somebody forgot about that below. -Adam Index: lib/test/unit/testcase.rb =================================================================== --- lib/test/unit/testcase.rb (revision 12221) +++ lib/test/unit/testcase.rb (working copy) @@ -37,7 +37,9 @@ # Creates a new instance of the fixture for running the # test represented by test_method_name. def initialize(test_method_name) - unless(respond_to?(test_method_name) && method(test_method_name).arity == 0) + unless(respond_to?(test_method_name) and + (method(test_method_name).arity == 0 || + method(test_method_name).arity == -1)) throw :invalid_test end @method_name = test_method_name ------=_Part_111218_30734158.1177570581506--