test/spec_rack_webrick.rb in rack-0.1.0 vs test/spec_rack_webrick.rb in rack-0.2.0

- old
+ new

@@ -81,9 +81,26 @@ GET("/test?secret") status.should.equal 403 response["rack.url_scheme"].should.equal "http" end + specify "should provide a .run" do + block_ran = false + catch(:done) { + Rack::Handler::WEBrick.run(lambda {}, + {:Port => 9210, + :Logger => WEBrick::Log.new(nil, WEBrick::BasicLog::WARN), + :AccessLog => []}) { |server| + block_ran = true + server.should.be.kind_of WEBrick::HTTPServer + @s = server + throw :done + } + } + block_ran.should.be true + @s.shutdown + end + teardown do @server.shutdown end end