From: Stevan Little Date: Tue, 22 Jul 2008 15:59:12 +0000 (+0000) Subject: fixing theplers tests X-Git-Tag: 0_55~42 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=59ab4a2e988faccabcf709aee6ecf8ac90218875;p=gitmo%2FMoose.git fixing theplers tests --- diff --git a/Makefile.PL b/Makefile.PL index f704e63..4effc67 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -12,7 +12,7 @@ my $win32 = !! ( $^O eq 'Win32' or $^O eq 'cygwin' ); # prereqs requires 'Scalar::Util' => $win32 ? '1.17' : '1.18'; requires 'Carp'; -requires 'Class::MOP' => '0.59'; +requires 'Class::MOP' => '0.64'; requires 'Sub::Exporter' => '0.972'; # only used by oose.pm, not Moose.pm :P diff --git a/t/100_bugs/018_immutable_metaclass_does_role.t b/t/100_bugs/018_immutable_metaclass_does_role.t index 280af26..725bfdb 100644 --- a/t/100_bugs/018_immutable_metaclass_does_role.t +++ b/t/100_bugs/018_immutable_metaclass_does_role.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 5; +use Test::More tests => 27; use Test::Exception; BEGIN { @@ -42,30 +42,43 @@ my $a = MyClass->new; ok( $a->meta->meta->does_role('MyRole'), 'metaclass does MyRole' ); ok( MyClass->meta->meta->does_role('MyRole'), 'metaclass does MyRole' ); -diag join ", " => map { $_->name } @{$mc->meta->roles}; -diag join ", " => map { $_->name } $mc->meta->calculate_all_roles; - lives_ok { MyClass->meta->make_immutable; } '... make MyClass immutable okay'; -diag join ", " => map { $_->name } @{$mc->meta->roles}; -diag join ", " => map { $_->name } $mc->meta->calculate_all_roles; - is(MyClass->meta, $mc, '... these metas are still the same thing'); is(MyClass->meta->meta, $mc->meta, '... these meta-metas are the same thing'); ok( $a->meta->meta->does_role('MyRole'), 'metaclass does MyRole' ); ok( MyClass->meta->meta->does_role('MyRole'), 'metaclass does MyRole' ); -=pod +lives_ok { + MyClass->meta->make_mutable; +} '... make MyClass immutable okay'; + +is(MyClass->meta, $mc, '... these metas are still the same thing'); +is(MyClass->meta->meta, $mc->meta, '... these meta-metas are the same thing'); -MyClass->meta->make_mutable; ok( $a->meta->meta->does_role('MyRole'), 'metaclass does MyRole' ); +ok( MyClass->meta->meta->does_role('MyRole'), 'metaclass does MyRole' ); + +lives_ok { + MyMetaclass->meta->make_immutable; +} '... make MyClass immutable okay'; + +is(MyClass->meta, $mc, '... these metas are still the same thing'); +is(MyClass->meta->meta, $mc->meta, '... these meta-metas are the same thing'); -MyMetaclass->meta->make_immutable; ok( $a->meta->meta->does_role('MyRole'), 'metaclass does MyRole' ); +ok( MyClass->meta->meta->does_role('MyRole'), 'metaclass does MyRole' ); + +lives_ok { + MyClass->meta->make_immutable; +} '... make MyClass immutable okay'; + +is(MyClass->meta, $mc, '... these metas are still the same thing'); +is(MyClass->meta->meta, $mc->meta, '... these meta-metas are the same thing'); -MyClass->meta->make_immutable; ok( $a->meta->meta->does_role('MyRole'), 'metaclass does MyRole' ); +ok( MyClass->meta->meta->does_role('MyRole'), 'metaclass does MyRole' );