File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ class ResolvTimeout < Timeout::Error; end
182
182
class Hosts
183
183
if WINDOWS
184
184
begin
185
- require 'win32/resolv'
185
+ require 'win32/resolv' unless defined? ( Win32 :: Resolv )
186
186
DefaultFileName = Win32 ::Resolv . get_hosts_path || IO ::NULL
187
187
rescue LoadError
188
188
end
@@ -1023,7 +1023,7 @@ def Config.default_config_hash(filename="/etc/resolv.conf")
1023
1023
config_hash = Config . parse_resolv_conf ( filename )
1024
1024
else
1025
1025
if WINDOWS
1026
- require 'win32/resolv'
1026
+ require 'win32/resolv' unless defined? ( Win32 :: Resolv )
1027
1027
search , nameserver = Win32 ::Resolv . get_resolv_info
1028
1028
config_hash = { }
1029
1029
config_hash [ :nameserver ] = nameserver if nameserver
Original file line number Diff line number Diff line change 1
1
require "test/unit"
2
2
require "core_assertions"
3
3
4
+ if RUBY_PLATFORM =~ /mswin|mingw/
5
+ # "win32/resolv" is installation path by Ruby installer.
6
+ # We should load that file manually for testing with Windows platform.
7
+ require_relative "../../ext/win32/resolv/lib/resolv"
8
+ end
9
+
4
10
Test ::Unit ::TestCase . include Test ::Unit ::CoreAssertions
You can’t perform that action at this time.
0 commit comments