Project

General

Profile

Feature #2643 ยป test-unit-redefinition-check.patch

mame (Yusuke Endoh), 01/25/2010 07:41 PM

View differences:

lib/test/unit/testcase.rb
10 10
      def self.test_order
11 11
        :sorted
12 12
      end
13

  
14
      Methods = {}
15

  
16
      def self.method_added(name)
17
       return unless name.to_s[/\Atest_/]
18
       Methods[self] ||= {}
19
       if Methods[self][name]
20
         warn("test/unit warning: method #{ self }##{ name } is redefined")
21
       end
22
       Methods[self][name] = true
23
      end
13 24
    end
14 25
  end
15 26
end