1 use Test::More tests => 6;
4 use Moose::Meta::Class;
5 #use Moose::Meta::Attribute;
9 use_ok('Catalyst::Action');
11 my $action_1 = Catalyst::Action->new(
13 code => sub { "DUMMY" },
22 my $action_2 = Catalyst::Action->new(
24 code => sub { "DUMMY" },
33 is("${action_1}", $action_1->reverse, 'overload string');
34 is($action_1->(), 'DUMMY', 'overload code');
36 my $anon_meta = Moose::Meta::Class->create_anon_class(
38 Moose::Meta::Attribute->new(
42 default => sub { Catalyst::Request->new(_log => Catalyst::Log->new, arguments => [qw/one two/]) },
46 methods => { req => sub { shift->request(@_) } }
49 my $mock_c = $anon_meta->new_object();
52 ok(!$action_1->match($mock_c), 'bad match fails');
53 ok($action_2->match($mock_c), 'good match works');
55 ok($action_2->compare( $action_1 ), 'compare works');