mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/test/unit/testcase.rb(method_added): refactoring.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3b15805c72
commit
d5a190c942
2 changed files with 11 additions and 9 deletions
|
@ -21,15 +21,13 @@ module Test
|
|||
:sorted
|
||||
end
|
||||
|
||||
Methods = {}
|
||||
|
||||
def self.method_added(name)
|
||||
return unless name.to_s[/\Atest_/]
|
||||
Methods[self] ||= {}
|
||||
if Methods[self][name]
|
||||
warn("test/unit warning: method #{ self }##{ name } is redefined")
|
||||
end
|
||||
Methods[self][name] = true
|
||||
return unless name.to_s.start_with?("test_")
|
||||
@test_methods ||= {}
|
||||
if @test_methods[name]
|
||||
warn "test/unit warning: method #{ self }##{ name } is redefined"
|
||||
end
|
||||
@test_methods[name] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue