Use rack's new handler registration stuff to fix some failing specs

This commit is contained in:
Ryan Tomayko 2009-05-20 18:13:38 -07:00
parent da29d46836
commit 99aa7ecaf8
1 changed files with 13 additions and 9 deletions

View File

@ -1,17 +1,21 @@
require File.dirname(__FILE__) + '/helper'
class Rack::Handler::Mock
extend Test::Unit::Assertions
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
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