Skip to content

Commit

Permalink
rb: Silence WEBrick output in specs
Browse files Browse the repository at this point in the history
  • Loading branch information
p0deje committed Sep 18, 2015
1 parent 8b359c3 commit c7d9e98
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def start
end

def run
handler.run @app, :Host => @host, :Port => @port
handler.run @app, run_options_for(handler)
end

def where_is(file)
Expand Down Expand Up @@ -90,6 +90,16 @@ def load_handler(handler)
false
end

def run_options_for(handler)
run_opts = {:Host => @host, :Port => @port}

if handler == Rack::Handler::WEBrick
run_opts.merge!(:Logger => WEBrick::Log.new("/dev/null"), :AccessLog => [])
end

run_opts
end

def start_forked
@pid = fork { run }
end
Expand Down

0 comments on commit c7d9e98

Please sign in to comment.