1 # -*- encoding: binary -*-
4 class TestHTTPReader < Test::Unit::TestCase
7 s = TCPServer.new(host, 0)
11 c.write("HTTP/1.0 200 OK\r\nContent-Length: 666\r\n\r\n666")
14 path = "http://#{host}:#{s.addr[1]}/"
15 r = MogileFS::HTTPReader.try(path, 666, nil)
25 assert_raises(MogileFS::SizeMismatchError) { r.to_s }
29 def test_short_stream_to
31 assert_raises(MogileFS::SizeMismatchError) { r.stream_to("/dev/null") }