lib/teaspoon/server.rb in teaspoon-0.7.8 vs lib/teaspoon/server.rb in teaspoon-0.7.9
- old
+ new
@@ -5,11 +5,17 @@
module Teaspoon
class Server
def initialize
@port = find_available_port
- Thin::Logging.silent = true if defined?(Thin)
+ if defined?(Thin)
+ if Teaspoon.configuration.suppress_log
+ Thin::Logging.silent = true
+ else
+ Thin::Logging.trace = false
+ end
+ end
end
def start
STDOUT.print "Starting the Teaspoon server...\n" unless Teaspoon.configuration.suppress_log
@thread = Thread.new do
@@ -20,11 +26,11 @@
rescue => e
raise "Cannot start server: #{e.message}"
end
def wait_until_started
- Timeout.timeout(Teaspoon.configuration.server_timeout) { @thread.join(0.1) until responsive? }
+ Timeout.timeout(Teaspoon.configuration.server_timeout.to_i) { @thread.join(0.1) until responsive? }
rescue Timeout::Error
raise "Server failed to start. You may need to increase the timeout configuration."
end
def responsive?
@@ -49,10 +55,10 @@
{
app: Rails.application,
Port: port,
environment: "test",
AccessLog: [],
- Logger: WEBrick::Log::new(nil, 0),
+ Logger: Rails.logger,
server: Teaspoon.configuration.server
}
end
def find_available_port