Skip to content

Commit 8d0d125

Browse files
authored
Replace deprecated Socket.gethostbyname with Addrinfo.getaddrinfo (#196)
Replace Socket.gethostbyname with Addrinfo.getaddrinfo in FreeBSD test Addrinfo.getaddrinfo is available since Ruby 1.9 Rubocop warning: ```console test/fiddle/test_handle.rb:225:7: W: Lint/DeprecatedClassMethods: Socket.gethostbyname is deprecated in favor of Addrinfo.getaddrinfo. Socket.gethostbyname("localhost") ^^^^^^^^^^^^^^^^^^^^ ```
1 parent e3dc030 commit 8d0d125

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/fiddle/test_handle.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def test_dlerror
222222
# In general uses of dlerror(3) should call it before use it.
223223
verbose, $VERBOSE = $VERBOSE, nil
224224
require 'socket'
225-
Socket.gethostbyname("localhost")
225+
Addrinfo.getaddrinfo("localhost", nil)
226226
Fiddle.dlopen("/lib/libc.so.7").sym('strcpy')
227227
ensure
228228
$VERBOSE = verbose

0 commit comments

Comments
 (0)