Skip to content

Commit

Permalink
Use rack's new handler registration stuff to fix some failing specs
Browse files Browse the repository at this point in the history
  • Loading branch information
rtomayko committed Jun 6, 2009
1 parent 68d5dc1 commit cb40723
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions test/server_test.rb
@@ -1,17 +1,21 @@
require File.dirname(__FILE__) + '/helper'

class Rack::Handler::Mock
extend Test::Unit::Assertions

def self.run(app, options={})
assert(app < Sinatra::Base)
assert_equal 9001, options[:Port]
assert_equal 'foo.local', options[:Host]
yield new
module Rack::Handler
class Mock
extend Test::Unit::Assertions

def self.run(app, options={})
assert(app < Sinatra::Base)
assert_equal 9001, options[:Port]
assert_equal 'foo.local', options[:Host]
yield new
end

def stop
end
end

def stop
end
register 'mock', 'Rack::Handler::Mock'
end

class ServerTest < Test::Unit::TestCase
Expand Down

0 comments on commit cb40723

Please sign in to comment.