mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Assert obsolete method warnings in IPAddr
This commit is contained in:
parent
fe03bbaf34
commit
6982a9049e
1 changed files with 9 additions and 3 deletions
|
@ -121,14 +121,20 @@ class TC_IPAddr < Test::Unit::TestCase
|
|||
assert_equal("::192.168.1.2", a.to_s)
|
||||
assert_equal("0000:0000:0000:0000:0000:0000:c0a8:0102", a.to_string)
|
||||
assert_equal(Socket::AF_INET6, a.family)
|
||||
assert_equal(true, a.ipv4_compat?)
|
||||
assert_warning(/obsolete/) {
|
||||
assert_predicate(a, :ipv4_compat?)
|
||||
}
|
||||
b = a.native
|
||||
assert_equal("192.168.1.2", b.to_s)
|
||||
assert_equal(Socket::AF_INET, b.family)
|
||||
assert_equal(false, b.ipv4_compat?)
|
||||
assert_warning(/obsolete/) {
|
||||
assert_not_predicate(b, :ipv4_compat?)
|
||||
}
|
||||
|
||||
a = IPAddr.new("192.168.1.2")
|
||||
b = a.ipv4_compat
|
||||
assert_warning(/obsolete/) {
|
||||
b = a.ipv4_compat
|
||||
}
|
||||
assert_equal("::192.168.1.2", b.to_s)
|
||||
assert_equal(Socket::AF_INET6, b.family)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue