1
0
Fork 0
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:
Nobuyoshi Nakada 2019-06-30 09:55:50 +09:00
parent 5f736d4319
commit cc68084652
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60
2 changed files with 3 additions and 1 deletions

View file

@ -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

View file

@ -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