Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed needless NullWriter class #182

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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