cfwheels/cfwheels — comment on commit 2289bcf1dc359eda3d391891712c405070a53012
File:  line 0
By rip747:

the best way to test something like is to not set the headers in the method directly but store them in a request.wheels.headers container. then you'll be able to access the container within your tests. you can then loop through the container and send the headers to the client in the onrequestend method.

this is how rack works. you build up an array containing the response, headers and status and at the end of the request rack send this information to the client.