1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Remove unneeded method redirect_test_io

This commit is contained in:
Santiago Pastorino 2012-06-29 21:41:03 -03:00
parent 5b789381ed
commit 26f2d462aa
2 changed files with 6 additions and 18 deletions

View file

@ -25,15 +25,11 @@ class WebServerTest < Test::Unit::TestCase
@server = Server.new @tester, Events.strings
@server.add_tcp_listener "127.0.0.1", 9998
redirect_test_io do
@server.run
end
@server.run
end
def teardown
redirect_test_io do
@server.stop(true)
end
@server.stop(true)
end
def test_simple_server
@ -73,17 +69,13 @@ class WebServerTest < Test::Unit::TestCase
end
def test_bad_client
redirect_test_io do
do_test("GET /test HTTP/BAD", 3)
end
do_test("GET /test HTTP/BAD", 3)
end
def test_header_is_too_long
redirect_test_io do
long = "GET /test HTTP/1.1\r\n" + ("X-Big: stuff\r\n" * 15000) + "\r\n"
assert_raises Errno::ECONNRESET, Errno::EPIPE, Errno::ECONNABORTED, Errno::EINVAL, IOError do
do_test(long, long.length/2, 10)
end
long = "GET /test HTTP/1.1\r\n" + ("X-Big: stuff\r\n" * 15000) + "\r\n"
assert_raises Errno::ECONNRESET, Errno::EPIPE, Errno::ECONNABORTED, Errno::EINVAL, IOError do
do_test(long, long.length/2, 10)
end
end

View file

@ -16,10 +16,6 @@ require 'stringio'
require 'puma'
def redirect_test_io
yield
end
# Either takes a string to do a get request against, or a tuple of [URI, HTTP] where
# HTTP is some kind of Net::HTTP request object (POST, HEAD, etc.)
def hit(uris)