aboutsummaryrefslogtreecommitdiffstats
path: root/test/socket/test_addrinfo.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/socket/test_addrinfo.rb')
-rw-r--r--test/socket/test_addrinfo.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/socket/test_addrinfo.rb b/test/socket/test_addrinfo.rb
index 132d172380..a06f3eb451 100644
--- a/test/socket/test_addrinfo.rb
+++ b/test/socket/test_addrinfo.rb
@@ -102,6 +102,14 @@ class TestSocketAddrinfo < Test::Unit::TestCase
assert(!ipv4_ai.unix?)
end
+ def test_error_message
+ e = assert_raise_with_message(SocketError, /getaddrinfo:/) do
+ Addrinfo.ip("...")
+ end
+ m = e.message
+ assert_not_equal([false, Encoding::ASCII_8BIT], [m.ascii_only?, m.encoding], proc {m.inspect})
+ end
+
def test_ipv4_address_predicates
list = [
[:ipv4_private?, "10.0.0.0", "10.255.255.255",