diff options
Diffstat (limited to 'lib/test/unit')
-rw-r--r-- | lib/test/unit/assertions.rb | 6 |
1 files changed, 4 insertions, 2 deletions
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) |