Methods
S
T
Instance Public methods
setup()
# File actionpack/test/dispatch/response_test.rb, line 6
def setup
  @response = ActionDispatch::Response.new
end
test_can_wait_until_commit()
# File actionpack/test/dispatch/response_test.rb, line 10
def test_can_wait_until_commit
  t = Thread.new {
    @response.await_commit
  }
  @response.commit!
  assert @response.committed?
  assert t.join(0.5)
end
test_response_body_encoding()
# File actionpack/test/dispatch/response_test.rb, line 39
def test_response_body_encoding
  body = ["hello".encode(Encoding::UTF_8)]
  response = ActionDispatch::Response.new 200, {}, body
  assert_equal Encoding::UTF_8, response.body.encoding
end
test_stream_close()
# File actionpack/test/dispatch/response_test.rb, line 19
def test_stream_close
  @response.stream.close
  assert @response.stream.closed?
end
test_stream_write()
# File actionpack/test/dispatch/response_test.rb, line 24
def test_stream_write
  @response.stream.write "foo"
  @response.stream.close
  assert_equal "foo", @response.body
end
test_write_after_close()
# File actionpack/test/dispatch/response_test.rb, line 30
def test_write_after_close
  @response.stream.close

  e = assert_raises(IOError) do
    @response.stream.write "omg"
  end
  assert_equal "closed stream", e.message
end