This file documents the revision history for Perl extension Catalyst.
5.57
+ - Updated uri_for to accept undef actions
- Switched to Module::Install
- Renamed tests for easier editing
- Reformatted documentation
# join args with '/', or a blank string
my $args = ( scalar @args ? '/' . join( '/', @args ) : '' );
- return URI->new_abs( URI->new_abs( "$path$args", "$basepath$namespace" ),
- $base )->canonical;
+ $args =~ s/^\/// unless $path;
+ my $res =
+ URI->new_abs( URI->new_abs( "$path$args", "$basepath$namespace" ), $base )
+ ->canonical;
+ $res;
}
=head2 $c->welcome_message
use strict;
use warnings;
-use Test::More tests => 6;
+use Test::More tests => 7;
use Test::MockObject;
use URI;
'URI for relative path'
);
+is(
+ Catalyst::uri_for( $context, '', 'arg1', 'arg2' )->as_string,
+ 'http://127.0.0.1/foo/yada/arg1/arg2',
+ 'URI for undef action with args'
+);
+
+
is( Catalyst::uri_for( $context, '../quux' )->as_string,
'http://127.0.0.1/foo/quux', 'URI for relative dot path' );