Skip to content

Commit d22211d

Browse files
authored
Merge pull request #182 from ruby/remove-null-writer
Removed needless NullWriter class
2 parents 4db7011 + ddb2a81 commit d22211d

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

test/net/http/utils.rb

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def start(&block)
234234
def new
235235
klass = Net::HTTP::Proxy(config('proxy_host'), config('proxy_port'))
236236
http = klass.new(config('host'), config('port'))
237-
http.set_debug_output logfile()
237+
http.set_debug_output logfile
238238
http
239239
end
240240

@@ -244,7 +244,7 @@ def config(key)
244244
end
245245

246246
def logfile
247-
$DEBUG ? $stderr : NullWriter.new
247+
$stderr if $DEBUG
248248
end
249249

250250
def setup
@@ -334,16 +334,6 @@ def parse_content_type(content_type)
334334
$test_net_http_data.force_encoding("ASCII-8BIT")
335335
$test_net_http_data_type = 'application/octet-stream'
336336

337-
class NullWriter
338-
def <<(_s); end
339-
340-
def puts(*_args); end
341-
342-
def print(*_args); end
343-
344-
def printf(*_args); end
345-
end
346-
347337
def self.clean_http_proxy_env
348338
orig = {
349339
'http_proxy' => ENV['http_proxy'],

0 commit comments

Comments
 (0)