X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Faggregate%2Funit_load_catalyst_test.t;h=a39498b331326d807add77218ea126fb3ffda08a;hp=036c3b8a1ab82812625bfc46427965e762dd6845;hb=35b3434762d426e0cd5e04eb735291f8ca7ea08e;hpb=ec6213a04492828a8d90c48c00e57fd1f840b353 diff --git a/t/aggregate/unit_load_catalyst_test.t b/t/aggregate/unit_load_catalyst_test.t index 036c3b8..a39498b 100644 --- a/t/aggregate/unit_load_catalyst_test.t +++ b/t/aggregate/unit_load_catalyst_test.t @@ -8,7 +8,7 @@ use FindBin qw/$Bin/; use lib "$Bin/../lib"; use Catalyst::Utils; use HTTP::Request::Common; -use Test::Exception; +use Test::Fatal; my $Class = 'Catalyst::Test'; my $App = 'TestApp'; @@ -88,7 +88,7 @@ use Catalyst::Test (); ok( $c->stash, " Stash accessible" ); ok( $c->action, " Action object accessible" ); ok( $res->request, " Response has request object" ); - lives_and { is( $res->request->uri, $Url) } + is exception { is( $res->request->uri, $Url) }, undef, " Request object has correct url"; } } } @@ -107,7 +107,7 @@ use Catalyst::Test (); # FIXME - These vhosts in tests tests should be somewhere else... -sub customize { Catalyst::Test::_customize_request(@_) } +sub customize { Catalyst::Test::_customize_request($_[0], {}, @_[1 .. $#_]) } { my $req = Catalyst::Utils::request('/dummy'); @@ -146,11 +146,15 @@ sub customize { Catalyst::Test::_customize_request(@_) } use_ok('Catalyst::Test', 'TestApp', 'foobar'); # Back compat test, ensure that request ignores anything which isn't a hash. -lives_ok { +is exception { request(GET('/dummy'), 'foo'); -} 'scalar additional param to request method ignored'; -lives_ok { +}, undef, 'scalar additional param to request method ignored'; +is exception { request(GET('/dummy'), []); -} 'array additional param to request method ignored'; +}, undef, 'array additional param to request method ignored'; + +my $res = request(GET('/')); +is $res->code, 200, 'Response code 200'; +is $res->headers->{status}, 200, 'Back compat "status" header present'; done_testing;