X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Faggregate%2Funit_core_uri_for.t;h=d3696a2e84d4553e1a1c995aebba84cb9d91cb63;hp=dad5a1ce6e9f37b7c8cd5344c56981855521c4b7;hb=6ed75978febef041904175e1c319c2698568db28;hpb=5a8e2ba0c3ec3c666760f09411ff56c8d13a4482 diff --git a/t/aggregate/unit_core_uri_for.t b/t/aggregate/unit_core_uri_for.t index dad5a1c..d3696a2 100644 --- a/t/aggregate/unit_core_uri_for.t +++ b/t/aggregate/unit_core_uri_for.t @@ -8,6 +8,7 @@ use URI; use_ok('TestApp'); my $request = Catalyst::Request->new( { + _log => Catalyst::Log->new, base => URI->new('http://127.0.0.1/foo') } ); my $dispatcher = TestApp->dispatcher; @@ -58,14 +59,11 @@ is( 'Plus is not encoded' ); -TODO: { - local $TODO = 'broken by 5.7008'; - is( - Catalyst::uri_for( $context, '/bar#fragment', { param1 => 'value1' } )->as_string, - 'http://127.0.0.1/foo/bar?param1=value1#fragment', - 'URI for path with fragment and query params' - ); -} +is( + Catalyst::uri_for( $context, '/bar#fragment', { param1 => 'value1' } )->as_string, + 'http://127.0.0.1/foo/bar?param1=value1#fragment', + 'URI for path with fragment and query params' +); # test with utf-8 is( @@ -180,5 +178,16 @@ TODO: { ); } -done_testing; +{ + package MyStringThing; + + use overload '""' => sub { $_[0]->{string} }, fallback => 1; +} +is( + Catalyst::uri_for( $context, bless( { string => 'test' }, 'MyStringThing' ) ), + 'http://127.0.0.1/test', + 'overloaded object handled correctly' +); + +done_testing;