Skip to content

Commit

Permalink
simplify by consolidating server run logic on to server
Browse files Browse the repository at this point in the history
  • Loading branch information
geemus committed Jul 8, 2010
1 parent 0cf4452 commit fffaee4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
12 changes: 11 additions & 1 deletion lib/radome/server.rb
Expand Up @@ -4,7 +4,17 @@
module Radome
class Server < Sinatra::Base

def initialize(*args)
def self.run
server = Radome::Server.new
Rack::Handler::WEBrick.run(
server,
:Port => 9292,
:AccessLog => [],
:Logger => WEBrick::Log.new(nil, WEBrick::Log::ERROR)
)
end

def initialize
@data_store = DataStore.new
super
end
Expand Down
7 changes: 1 addition & 6 deletions tests/helpers.rb
Expand Up @@ -3,12 +3,7 @@

def with_server(&block)
pid = Process.fork do
Rack::Handler::WEBrick.run(
Radome::Server.new,
:Port => 9292,
:AccessLog => [],
:Logger => WEBrick::Log.new(nil, WEBrick::Log::ERROR)
)
Radome::Server.run
end
sleep(1)
yield
Expand Down

0 comments on commit fffaee4

Please sign in to comment.