Permalink
Browse files

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

  • Loading branch information...
1 parent 68d5dc1 commit cb4072383544d49a1ab6dcbc5e942fbdd4503082 @rtomayko rtomayko committed May 21, 2009
Showing with 14 additions and 10 deletions.
  1. +14 −10 test/server_test.rb
View
@@ -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

0 comments on commit cb40723

Please sign in to comment.