PerlDancer/Dancer2 — pull request #62 by yanick (2012-09-22 15:19:57+00:00)
Title: make dancer_response returns a Dancer::Core::Response

The test function 'dancer_response' was returning its psgi
representation, and I changed that to just returning the
Dancer::Core::Response object. The motivation for doing that
is 3-fold:

a) it's more intuitive for 'dancer_response' to return a, well,
Dancer::Core::Response, and make further tests easier to read:

is $res->status => 200;

versus

is $res->[0] => 200;

Also, nothing is lost as, if one really desires the psgi
format, one can still do '$res->to_psgi'.

b) while it's not 100% compatible with Dancer1's 'dancer_response,
it's going to be close as things like

$res->{content}

will still work (thanks to Moo and Moose stashing their attributes
as a good ol' hash ref)

In that regard, if the return values of dancer_response do
turn out to cause problem for many plugins, I'm considering having
a 'v1_behavior' flag for Test::Dancer that would make dancer_response
returns the same hashref than in Dancer1. But then, having peeps add this flag
will probably be just as much work as changing all $res->{stuff} to
$res->stuff, so... I don't know, we'll see later.