diff --git a/ChangeLog b/ChangeLog index affcd131c7..c6eb2275f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Feb 27 22:09:24 2009 Tanaka Akira + + * lib/test/unit/assertions.rb: don't define assert_not_* if already + overridden. + Fri Feb 27 22:02:34 2009 Tanaka Akira * util.c: fix SEGV by test_time.rb with diff --git a/lib/test/unit/assertions.rb b/lib/test/unit/assertions.rb index de357d0fea..35348d87be 100644 --- a/lib/test/unit/assertions.rb +++ b/lib/test/unit/assertions.rb @@ -122,8 +122,10 @@ EOT super if !caller[0].rindex(MiniTest::MINI_DIR, 0) || !obj.respond_to?(meth) end - instance_methods(true).grep(/\Arefute_/) do |m| - alias_method(('assert_not_' << m.to_s[/.*?_(.*)/, 1]), m) + ms = instance_methods(true).map {|sym| sym.to_s } + ms.grep(/\Arefute_/) do |m| + mname = ('assert_not_' << m.to_s[/.*?_(.*)/, 1]) + alias_method(mname, m) unless ms.include? mname end def build_message(head, template=nil, *arguments)