mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Suppress method redefinition warnings
This commit is contained in:
parent
5f736d4319
commit
cc68084652
2 changed files with 3 additions and 1 deletions
|
@ -464,12 +464,13 @@ class TestISeq < Test::Unit::TestCase
|
|||
RUBY
|
||||
|
||||
iseq_bin = iseq.to_binary
|
||||
iseq = ISeq.load_from_binary(iseq_bin)
|
||||
lines = []
|
||||
TracePoint.new(tracepoint_type){|tp|
|
||||
next unless tp.path == filename
|
||||
lines << tp.lineno
|
||||
}.enable{
|
||||
ISeq.load_from_binary(iseq_bin).eval
|
||||
EnvUtil.suppress_warning {iseq.eval}
|
||||
}
|
||||
|
||||
lines
|
||||
|
|
|
@ -269,6 +269,7 @@ class TestPrime < Test::Unit::TestCase
|
|||
end
|
||||
ensure
|
||||
class << Integer
|
||||
remove_method :sqrt
|
||||
alias_method :sqrt, :org_sqrt
|
||||
remove_method :org_sqrt
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue