X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Funit_load_catalyst_test.t;h=3c9eca9ee938dddda8d2e9e7d9e18b90d730d8ef;hb=7bf342486846ff902822a01c8df4689bfa7a6a6f;hp=9c9c61cf67a2d7449d79e0f84c7c3c78b37962b3;hpb=d9d04deddc21923005721f9f86298b068c656369;p=catagits%2FCatalyst-Runtime.git diff --git a/t/unit_load_catalyst_test.t b/t/unit_load_catalyst_test.t index 9c9c61c..3c9eca9 100644 --- a/t/unit_load_catalyst_test.t +++ b/t/unit_load_catalyst_test.t @@ -4,9 +4,13 @@ use strict; use warnings; use Test::More; +use FindBin qw/$Bin/; +use lib "$Bin/lib"; use Catalyst::Utils; +use HTTP::Request::Common; +use Test::Exception; -plan tests => 8; +plan tests => 11; use_ok('Catalyst::Test'); @@ -16,6 +20,8 @@ isnt( $@, "", "get returns an error message with no app specified"); eval "request('http://localhost')"; isnt( $@, "", "request returns an error message with no app specified"); +# FIXME - These vhosts in tests tests should be somewhere else... + sub customize { Catalyst::Test::_customize_request(@_) } { @@ -50,3 +56,14 @@ sub customize { Catalyst::Test::_customize_request(@_) } customize( $req, { host => '' } ); is( $req->header('Host'), undef, 'default value can be temporarily cleared via opts hash' ); } + +# Back compat test, extra args used to be ignored, now a hashref of options. +use_ok('Catalyst::Test', 'TestApp', 'foobar'); + +# Back compat test, ensure that request ignores anything which isn't a hash. +lives_ok { + request(GET('/dummy'), 'foo'); +} 'scalar additional param to request method ignored'; +lives_ok { + request(GET('/dummy'), []); +} 'array additional param to request method ignored';