Changeset 488
- Timestamp:
- 07/28/07 14:41:17 (1 year ago)
- Files:
-
- version_0/tests/test_send_file.rb (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
version_0/tests/test_send_file.rb
r485 r488 38 38 39 39 TestHost = "0.0.0.0" 40 TestPort = 90 0540 TestPort = 9055 41 41 TestFilename = "./xxxxxx" 42 42 … … 70 70 end 71 71 72 # EventMachine::Connection#send_file_data has a strict upper limit on the filesize it will work with. 72 73 def test_send_large_file 73 74 File.open( TestFilename, "w" ) {|f| … … 77 78 data = nil 78 79 79 EM.run { 80 EM.start_server TestHost, TestPort, TestModule 81 EM.add_timer(2) {EM.stop} # avoid hanging in case of error 82 EM.defer proc { 83 t = TCPSocket.new TestHost, TestPort 84 data = t.read 85 }, proc { 86 EM.stop 87 } 88 } 89 90 assert_equal( "A" * 1000000, data ) 80 assert_raise(RuntimeError) { 81 EM.run { 82 EM.start_server TestHost, TestPort, TestModule 83 EM.add_timer(2) {EM.stop} # avoid hanging in case of error 84 EM.defer proc { 85 t = TCPSocket.new TestHost, TestPort 86 data = t.read 87 }, proc { 88 EM.stop 89 } 90 } 91 } 92 91 93 File.unlink TestFilename 92 94 end
