# Parse out :Foo(bar) into Foo => bar etc (and arrayify)
- if ( my ( $key, $value ) = ( $attr =~ /^(.*?)(?:\(\s*(.+?)\s*\))?$/ ) )
+ if ( my ( $key, $value ) = ( $attr =~ /^(.*?)(?:\(\s*(.*?)\s*\))?$/ ) )
{
if ( defined $value ) {
--- /dev/null
+package TestPath;
+use strict;
+use warnings;
+use Catalyst;
+
+__PACKAGE__->setup;
+
+1;
--- /dev/null
+package TestPath::Controller::One;
+use Moose;
+use namespace::autoclean;
+
+BEGIN { extends 'Catalyst::Controller' }
+
+sub one :Path {
+ my ( $self, $c ) = @_;
+ $c->response->body( 'OK' );
+}
+
+__PACKAGE__->meta->make_immutable;
\ No newline at end of file
--- /dev/null
+package TestPath::Controller::Three;
+use Moose;
+use namespace::autoclean;
+
+BEGIN { extends 'Catalyst::Controller' }
+
+sub three :Path('') {
+ my ( $self, $c ) = @_;
+ $c->response->body( 'OK' );
+}
+
+__PACKAGE__->meta->make_immutable;
\ No newline at end of file
--- /dev/null
+package TestPath::Controller::Two;
+use Moose;
+use namespace::autoclean;
+
+BEGIN { extends 'Catalyst::Controller' }
+
+sub two :Path() {
+ my ( $self, $c ) = @_;
+ $c->response->body( 'OK' );
+}
+
+__PACKAGE__->meta->make_immutable;
\ No newline at end of file
--- /dev/null
+use strict;
+use warnings;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+use Test::More tests => 9;
+use Catalyst::Test 'TestPath';
+
+
+{
+ ok( my $response = request('http://localhost/one'), 'Request' );
+ ok( $response->is_success, '"Path" - Response Successful 2xx' );
+ is( $response->content, 'OK', '"Path" - Body okay' );
+}
+{
+ ok( my $response = request('http://localhost/two'), 'Request' );
+ ok( $response->is_success, '"Path()" - Response Successful 2xx' );
+ is( $response->content, 'OK', '"Path()" - Body okay' );
+}
+{
+ ok( my $response = request('http://localhost/three'), 'Request' );
+ ok( $response->is_success, '"Path(\'\')" - Response Successful 2xx' );
+ is( $response->content, 'OK', '"Path(\'\')" - Body okay' );
+}
+
+