From: Jesse Luehrs Date: Mon, 10 May 2010 21:18:53 +0000 (-0500) Subject: add some more tests X-Git-Tag: 1.05~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=38bf6bf30084850d3e650ac87cb56a9fed0e51be;p=gitmo%2FMoose.git add some more tests --- diff --git a/t/050_metaclasses/052_metaclass_compat.t b/t/050_metaclasses/052_metaclass_compat.t index e6d9f45..f29db50 100644 --- a/t/050_metaclasses/052_metaclass_compat.t +++ b/t/050_metaclasses/052_metaclass_compat.t @@ -1,6 +1,7 @@ #!/usr/bin/env perl use strict; use warnings; +use lib 't/lib'; use Test::More; use Test::Exception; @@ -277,4 +278,28 @@ ok(Foo::Sub->meta->constructor_class->meta->can('does_role') 'unsafe MI extends after_generated_methods with metaclass roles (reverse)'; } +{ + package Foo7::Meta::Trait; + use Moose::Role; +} + +{ + package Foo7; + use Moose -traits => ['Foo7::Meta::Trait']; +} + +{ + package Bar7; + # in an external file + use Moose -traits => ['Bar7::Meta::Trait']; + ::lives_ok { extends 'Foo7' } "role reconciliation works"; +} + +{ + package Bar72; + # in an external file + use Moose -traits => ['Bar7::Meta::Trait2']; + ::lives_ok { extends 'Foo7' } "role reconciliation works"; +} + done_testing; diff --git a/t/lib/Bar7/Meta/Trait.pm b/t/lib/Bar7/Meta/Trait.pm new file mode 100644 index 0000000..aec769b --- /dev/null +++ b/t/lib/Bar7/Meta/Trait.pm @@ -0,0 +1,8 @@ +package Bar7::Meta::Trait; +use Moose::Role; + +around _immutable_options => sub { }; + +no Moose::Role; + +1; diff --git a/t/lib/Bar7/Meta/Trait2.pm b/t/lib/Bar7/Meta/Trait2.pm new file mode 100644 index 0000000..4f1b73f --- /dev/null +++ b/t/lib/Bar7/Meta/Trait2.pm @@ -0,0 +1,13 @@ +package Bar7::Meta::Trait2; +use Moose::Role; + +has foo => ( + traits => ['Array'], + handles => { + push_foo => 'push', + }, +); + +no Moose::Role; + +1;