From ddb2a81aed5c488276d76451fdfedc7c6d1dd059 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 25 Jul 2024 16:50:33 +0800 Subject: [PATCH] Removed needless NullWriter class --- test/net/http/utils.rb | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/test/net/http/utils.rb b/test/net/http/utils.rb index 39f4152..6da7175 100644 --- a/test/net/http/utils.rb +++ b/test/net/http/utils.rb @@ -234,7 +234,7 @@ def start(&block) def new klass = Net::HTTP::Proxy(config('proxy_host'), config('proxy_port')) http = klass.new(config('host'), config('port')) - http.set_debug_output logfile() + http.set_debug_output logfile http end @@ -244,7 +244,7 @@ def config(key) end def logfile - $DEBUG ? $stderr : NullWriter.new + $stderr if $DEBUG end def setup @@ -334,16 +334,6 @@ def parse_content_type(content_type) $test_net_http_data.force_encoding("ASCII-8BIT") $test_net_http_data_type = 'application/octet-stream' - class NullWriter - def <<(_s); end - - def puts(*_args); end - - def print(*_args); end - - def printf(*_args); end - end - def self.clean_http_proxy_env orig = { 'http_proxy' => ENV['http_proxy'],