X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=trunk%2Ft%2Faggregate%2Funit_core_action.t;fp=trunk%2Ft%2Faggregate%2Funit_core_action.t;h=0000000000000000000000000000000000000000;hb=f436bc1bece2bcc2a04138068e5c22e70d9d6d35;hp=ca84422325a2c5a4becdc4b2b88ffd1b327fb479;hpb=e28a6876ad3e11890226e5bab6df4b0725e0981e;p=catagits%2FCatalyst-Runtime.git diff --git a/trunk/t/aggregate/unit_core_action.t b/trunk/t/aggregate/unit_core_action.t deleted file mode 100644 index ca84422..0000000 --- a/trunk/t/aggregate/unit_core_action.t +++ /dev/null @@ -1,54 +0,0 @@ -use Test::More tests => 6; -use strict; -use warnings; -use Moose::Meta::Class; -#use Moose::Meta::Attribute; -use Catalyst::Request; - -use_ok('Catalyst::Action'); - -my $action_1 = Catalyst::Action->new( - name => 'foo', - code => sub { "DUMMY" }, - reverse => 'bar/foo', - namespace => 'bar', - attributes => { - Args => [ 1 ], - attr2 => [ 2 ], - }, -); - -my $action_2 = Catalyst::Action->new( - name => 'foo', - code => sub { "DUMMY" }, - reverse => 'bar/foo', - namespace => 'bar', - attributes => { - Args => [ 2 ], - attr2 => [ 2 ], - }, -); - -is("${action_1}", $action_1->reverse, 'overload string'); -is($action_1->(), 'DUMMY', 'overload code'); - -my $anon_meta = Moose::Meta::Class->create_anon_class( - attributes => [ - Moose::Meta::Attribute->new( - request => ( - reader => 'request', - required => 1, - default => sub { Catalyst::Request->new(arguments => [qw/one two/]) }, - ), - ), - ], - methods => { req => sub { shift->request(@_) } } -); - -my $mock_c = $anon_meta->new_object(); -$mock_c->request; - -ok(!$action_1->match($mock_c), 'bad match fails'); -ok($action_2->match($mock_c), 'good match works'); - -ok($action_2->compare( $action_1 ), 'compare works');