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
|
RUBY
|
||||||
|
|
||||||
iseq_bin = iseq.to_binary
|
iseq_bin = iseq.to_binary
|
||||||
|
iseq = ISeq.load_from_binary(iseq_bin)
|
||||||
lines = []
|
lines = []
|
||||||
TracePoint.new(tracepoint_type){|tp|
|
TracePoint.new(tracepoint_type){|tp|
|
||||||
next unless tp.path == filename
|
next unless tp.path == filename
|
||||||
lines << tp.lineno
|
lines << tp.lineno
|
||||||
}.enable{
|
}.enable{
|
||||||
ISeq.load_from_binary(iseq_bin).eval
|
EnvUtil.suppress_warning {iseq.eval}
|
||||||
}
|
}
|
||||||
|
|
||||||
lines
|
lines
|
||||||
|
|
|
@ -269,6 +269,7 @@ class TestPrime < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
ensure
|
ensure
|
||||||
class << Integer
|
class << Integer
|
||||||
|
remove_method :sqrt
|
||||||
alias_method :sqrt, :org_sqrt
|
alias_method :sqrt, :org_sqrt
|
||||||
remove_method :org_sqrt
|
remove_method :org_sqrt
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue