Add list of methods that will warn when undefined
This commit is contained in:
parent
21d5fe5dfb
commit
2c13a79147
1 changed files with 5 additions and 2 deletions
|
@ -7,6 +7,9 @@ module Mutant
|
|||
NAME_INDEX = 0
|
||||
SYMBOL = '#'.freeze
|
||||
|
||||
# A list of methods that will warn when they are undefined
|
||||
WARN_METHODS_UNDEFINED = [:initialize, :__send__, :object_id].freeze
|
||||
|
||||
# Test if method is public
|
||||
#
|
||||
# @return [Boolean]
|
||||
|
@ -26,8 +29,8 @@ module Mutant
|
|||
#
|
||||
def prepare
|
||||
expected_warnings =
|
||||
if RUBY_ENGINE.eql?('ruby') && name.equal?(:initialize)
|
||||
["#{__FILE__}:#{__LINE__ + 5}: warning: undefining `initialize' may cause serious problems\n"]
|
||||
if RUBY_ENGINE.eql?('ruby') && WARN_METHODS_UNDEFINED.include?(name)
|
||||
["#{__FILE__}:#{__LINE__ + 5}: warning: undefining `#{name}' may cause serious problems\n"]
|
||||
else
|
||||
[]
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue