mjijackson/strata — pull request #39 by jeffbski (2012-12-05 05:34:24+00:00)
Title: mock.call should support binary stream

mock.call should support a binary stream and return
a Buffer, but since originally this was returning body
as a string, this can be made as optional.

Use env.mockReturnsBuffer = true to keep
body being returned as a Buffer rather than converting
to a string as previously worked. Without the flag
body will still be converted to string.

Also note: Buffer.concat needs to be used to join chunks
using Buffers rather than simply using toString() otherwise
if utf8 strings are split across chunks it will result in
invalid data if joining toString() buffer chunks.