ruby-changes:56309
From: Nobuyoshi <ko1@a...>
Date: Mon, 1 Jul 2019 13:03:03 +0900 (JST)
Subject: [ruby-changes:56309] Nobuyoshi Nakada: 6982a9049e (master): Assert obsolete method warnings in IPAddr
https://git.ruby-lang.org/ruby.git/commit/?id=6982a9049e From 6982a9049ede1386fdfa10734f953867824ebe05 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Mon, 1 Jul 2019 13:01:31 +0900 Subject: Assert obsolete method warnings in IPAddr diff --git a/test/test_ipaddr.rb b/test/test_ipaddr.rb index 1aa24eb..7b3a199 100644 --- a/test/test_ipaddr.rb +++ b/test/test_ipaddr.rb @@ -121,14 +121,20 @@ class TC_IPAddr < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/test_ipaddr.rb#L121 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 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/