Skip to content

Commit

Permalink
Merge pull request #182 from ruby/remove-null-writer
Browse files Browse the repository at this point in the history
Removed needless NullWriter class
  • Loading branch information
hsbt authored Jul 26, 2024
2 parents 4db7011 + ddb2a81 commit d22211d
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions test/net/http/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -244,7 +244,7 @@ def config(key)
end

def logfile
$DEBUG ? $stderr : NullWriter.new
$stderr if $DEBUG
end

def setup
Expand Down Expand Up @@ -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'],
Expand Down

0 comments on commit d22211d

Please sign in to comment.