11 use_ok('Catalyst::Test');
13 eval "get('http://localhost')";
14 isnt( $@, "", "get returns an error message with no app specified");
16 eval "request('http://localhost')";
17 isnt( $@, "", "request returns an error message with no app specified");
19 sub customize { Catalyst::Test::_customize_request(@_) }
22 my $req = Catalyst::Utils::request('/dummy');
24 is( $req->header('Host'), undef, 'normal request is unmodified' );
28 my $req = Catalyst::Utils::request('/dummy');
29 customize( $req, { host => 'customized.com' } );
30 like( $req->header('Host'), qr/customized.com/, 'request is customizable via opts hash' );
34 my $req = Catalyst::Utils::request('/dummy');
35 local $Catalyst::Test::default_host = 'localized.com';
37 like( $req->header('Host'), qr/localized.com/, 'request is customizable via package var' );
41 my $req = Catalyst::Utils::request('/dummy');
42 local $Catalyst::Test::default_host = 'localized.com';
43 customize( $req, { host => 'customized.com' } );
44 like( $req->header('Host'), qr/customized.com/, 'opts hash takes precedence over package var' );
48 my $req = Catalyst::Utils::request('/dummy');
49 local $Catalyst::Test::default_host = 'localized.com';
50 customize( $req, { host => '' } );
51 is( $req->header('Host'), undef, 'default value can be temporarily cleared via opts hash' );