From 44f4f76d06899b1a0e4719671a4fde3c0851764a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 14 Feb 2013 11:32:11 +0000 Subject: test/http_range: do not allow webrick to perform lookups DNS lookups cause webrick tests to fail or timeout. Our tests should not have external network dependencies. --- test/http_range.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/http_range.rb b/test/http_range.rb index fe5f0a4..7b0182d 100644 --- a/test/http_range.rb +++ b/test/http_range.rb @@ -5,6 +5,7 @@ require 'test/test_helper' require 'net/http' require 'time' +def Socket.gethostbyname(*args); raise "disabled for test"; end require 'webrick' require 'stringio' @@ -32,6 +33,7 @@ class TestHTTPRange < Test::Unit::TestCase :DocumentRoot => @tmpdir, :ServerType => Thread, :Logger => WEBrick::Log.new(@wblogger), + :DoNotReverseLookup => true, } @webrick = WEBrick::HTTPServer.new(wbopts) @webrick.start -- cgit v1.2.3-24-ge0c7