1 use Test::More tests => 6;
4 use Moose::Meta::Class;
5 #use Moose::Meta::Attribute;
8 use_ok('Catalyst::Action');
10 my $action_1 = Catalyst::Action->new(
12 code => sub { "DUMMY" },
21 my $action_2 = Catalyst::Action->new(
23 code => sub { "DUMMY" },
32 is("${action_1}", $action_1->reverse, 'overload string');
33 is($action_1->(), 'DUMMY', 'overload code');
35 my $anon_meta = Moose::Meta::Class->create_anon_class(
37 Moose::Meta::Attribute->new(
41 default => sub { Catalyst::Request->new(arguments => [qw/one two/]) },
45 methods => { req => sub { shift->request(@_) } }
48 my $mock_c = $anon_meta->new_object();
51 ok(!$action_1->match($mock_c), 'bad match fails');
52 ok($action_2->match($mock_c), 'good match works');
54 ok($action_2->compare( $action_1 ), 'compare works');