diff options
Diffstat (limited to 't/metaclasses/metaclass_compat_no_fixing_bug.t')
-rw-r--r-- | t/metaclasses/metaclass_compat_no_fixing_bug.t | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/t/metaclasses/metaclass_compat_no_fixing_bug.t b/t/metaclasses/metaclass_compat_no_fixing_bug.t new file mode 100644 index 0000000..19ec76a --- /dev/null +++ b/t/metaclasses/metaclass_compat_no_fixing_bug.t @@ -0,0 +1,45 @@ +use strict; +use warnings; +use Test::More; +use Test::Fatal; + +{ + package Foo::Meta::Constructor1; + use Moose::Role; +} + +{ + package Foo::Meta::Constructor2; + use Moose::Role; +} + +{ + package Foo; + use Moose; + Moose::Util::MetaRole::apply_metaroles( + for => __PACKAGE__, + class_metaroles => { constructor => ['Foo::Meta::Constructor1'] }, + ); +} + +{ + package Foo::Sub; + use Moose; + Moose::Util::MetaRole::apply_metaroles( + for => __PACKAGE__, + class_metaroles => { constructor => ['Foo::Meta::Constructor2'] }, + ); + extends 'Foo'; +} + +{ + package Foo::Sub::Sub; + use Moose; + Moose::Util::MetaRole::apply_metaroles( + for => __PACKAGE__, + class_metaroles => { constructor => ['Foo::Meta::Constructor2'] }, + ); + ::is( ::exception { extends 'Foo::Sub' }, undef, "doesn't try to fix if nothing is needed" ); +} + +done_testing; |