当前位置: 动力学知识库 > 问答 > 编程问答 >

how can i verify data is streaming from a rails 3 template handler?

问题描述:

I've forked csv_builder to support a @streaming parameter. When streaming, the template handler uses a block like this:

Enumerator.new do |output|

output.write("writing some data")

end

I've verified that templates render properly, in terms of the content being correct, but I want to verify that data is streamed, rather than returned in one shot. One idea I had was to generate an enormous file inside a template. When I did this in an rspec test, it indeed takes a few minutes, but it passes when the template returns data in one shot.

分享给朋友:
您可能感兴趣的文章:
随机阅读: