From: Jesse Luehrs Date: Fri, 8 Oct 2010 01:54:57 +0000 (-0500) Subject: todo test for metarole compat when metaroles have application metaroles X-Git-Tag: 1.16~62 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4b9d46665d73a88477673bed833cc46efeb2e2e8;p=gitmo%2FMoose.git todo test for metarole compat when metaroles have application metaroles --- diff --git a/t/600_todo_tests/007_application_metarole_compat.t b/t/600_todo_tests/007_application_metarole_compat.t new file mode 100644 index 0000000..c254f51 --- /dev/null +++ b/t/600_todo_tests/007_application_metarole_compat.t @@ -0,0 +1,59 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; +use Test::Exception; + +BEGIN { + { + package Foo; + use Moose::Role; + } + + { + package Bar::Class; + use Moose::Role; + } + + { + package Bar::ToClass; + use Moose::Role; + + after apply => sub { + my $self = shift; + my ($role, $class) = @_; + Moose::Util::MetaRole::apply_metaroles( + for => $class, + class_metaroles => { + class => ['Bar::Class'], + } + ); + }; + } + + { + package Bar; + use Moose::Role; + Moose::Util::MetaRole::apply_metaroles( + for => __PACKAGE__, + role_metaroles => { + application_to_class => ['Bar::ToClass'], + } + ); + } +} + +{ + package Parent; + use Moose -traits => 'Foo'; +} + +{ + package Child; + use Moose -traits => 'Bar'; + { our $TODO; local $TODO = "no idea what's going on here"; + ::lives_ok { extends 'Parent' }; + } +} + +done_testing;