Fix model/view/controller methods to handle stringifiable objects
[catagits/Catalyst-Runtime.git] / t / aggregate / unit_core_uri_for.t
index dad5a1c..3318192 100644 (file)
@@ -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;
@@ -180,5 +181,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;