From: Tomas Doran (t0m Date: Sun, 10 May 2009 16:49:02 +0000 (+0100) Subject: Tweak latter instances of the test to remove the metaclass instances for the classes... X-Git-Tag: 0.78~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ef55236d74702a0abd8eaea73961381db5c11ae6;p=gitmo%2FMoose.git Tweak latter instances of the test to remove the metaclass instances for the classes which did not initially (at the time the sub class with the test in says 'extends') have them - therefore the latter tests still test the same issue --- diff --git a/t/060_compat/004_extends_nonmoose_that_isa_moose_with_metarole.t b/t/060_compat/004_extends_nonmoose_that_isa_moose_with_metarole.t index ba212df..bc175d4 100644 --- a/t/060_compat/004_extends_nonmoose_that_isa_moose_with_metarole.t +++ b/t/060_compat/004_extends_nonmoose_that_isa_moose_with_metarole.t @@ -1,6 +1,7 @@ use strict; use warnings; use Test::More tests => 18; +use Class::MOP (); { package My::Role; @@ -34,6 +35,11 @@ use Test::More tests => 18; 'SubSubClassUseBase meta metaclass does the My::Role role' ); } +# Note, remote metaclasses of the 'use base' classes after each test, so that +# they have to be re-initialized - otherwise latter tests would not demonstrate +# the original issue. +Class::MOP::remove_metaclass_by_name('SubClassUseBase'); + { package OtherClass; use Moose; @@ -61,6 +67,8 @@ use Test::More tests => 18; 'MultiParent1 meta metaclass does the My::Role role' ); } +Class::MOP::remove_metaclass_by_name(qw/SubClassUseBase OtherSubClassUseBase/); + { package MultiParent2; use Moose; @@ -78,6 +86,8 @@ use Test::More tests => 18; 'MultiParent2 meta metaclass does the My::Role role' ); } +Class::MOP::remove_metaclass_by_name(qw/SubClassUseBase OtherSubClassUseBase/); + { package MultiParent3; use Moose; @@ -95,6 +105,8 @@ use Test::More tests => 18; 'MultiParent3 meta metaclass does the My::Role role' ); } +Class::MOP::remove_metaclass_by_name(qw/SubClassUseBase OtherSubClassUseBase/); + { package MultiParent4; use Moose; @@ -112,6 +124,8 @@ use Test::More tests => 18; 'MultiParent4 meta metaclass does the My::Role role' ); } +Class::MOP::remove_metaclass_by_name(qw/SubClassUseBase OtherSubClassUseBase/); + { package MultiChild1; use Moose; @@ -129,6 +143,8 @@ use Test::More tests => 18; 'MultiChild1 meta metaclass does the My::Role role' ); } +Class::MOP::remove_metaclass_by_name(qw/SubClassUseBase OtherSubClassUseBase/); + { package MultiChild2; use Moose; @@ -146,6 +162,8 @@ use Test::More tests => 18; 'MultiChild2 meta metaclass does the My::Role role' ); } +Class::MOP::remove_metaclass_by_name(qw/SubClassUseBase OtherSubClassUseBase/); + { package MultiChild3; use Moose; @@ -163,6 +181,8 @@ use Test::More tests => 18; 'MultiChild3 meta metaclass does the My::Role role' ); } +Class::MOP::remove_metaclass_by_name(qw/SubClassUseBase OtherSubClassUseBase/); + { package MultiChild4; use Moose; @@ -180,3 +200,5 @@ use Test::More tests => 18; 'MultiChild4 meta metaclass does the My::Role role' ); } +Class::MOP::remove_metaclass_by_name(qw/SubClassUseBase OtherSubClassUseBase/); +