From: Dave Rolsky Date: Mon, 28 Jul 2008 13:38:11 +0000 (+0000) Subject: Add some tests to ensure that the ->foo() method is always present (as X-Git-Tag: 0_55~38 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fa25f2902a2cc6dabaca9275b7c83bde5d351150;p=gitmo%2FMoose.git Add some tests to ensure that the ->foo() method is always present (as expected). --- diff --git a/t/100_bugs/018_immutable_metaclass_does_role.t b/t/100_bugs/018_immutable_metaclass_does_role.t index 3a0a0f5..a245079 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 => 27; +use Test::More tests => 37; use Test::Exception; BEGIN { @@ -40,7 +40,9 @@ is(MyClass->meta->meta, $mc->meta, '... these meta-metas are the same thing'); my $a = MyClass->new; ok( $a->meta->meta->does_role('MyRole'), 'metaclass does MyRole' ); +is( $a->meta->foo, 'i am foo', '... foo method returns expected value' ); ok( MyClass->meta->meta->does_role('MyRole'), 'metaclass does MyRole' ); +is( MyClass->meta->foo, 'i am foo', '... foo method returns expected value' ); lives_ok { MyClass->meta->make_immutable; @@ -50,7 +52,9 @@ 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' ); +is( $a->meta->foo, 'i am foo', '... foo method returns expected value' ); ok( MyClass->meta->meta->does_role('MyRole'), 'metaclass does MyRole' ); +is( MyClass->meta->foo, 'i am foo', '... foo method returns expected value' ); lives_ok { MyClass->meta->make_mutable; @@ -60,7 +64,9 @@ 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' ); +is( $a->meta->foo, 'i am foo', '... foo method returns expected value' ); ok( MyClass->meta->meta->does_role('MyRole'), 'metaclass does MyRole' ); +is( MyClass->meta->foo, 'i am foo', '... foo method returns expected value' ); lives_ok { MyMetaclass->meta->make_immutable; @@ -70,7 +76,9 @@ 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' ); +is( $a->meta->foo, 'i am foo', '... foo method returns expected value' ); ok( MyClass->meta->meta->does_role('MyRole'), 'metaclass does MyRole' ); +is( MyClass->meta->foo, 'i am foo', '... foo method returns expected value' ); lives_ok { MyClass->meta->make_immutable; @@ -80,5 +88,7 @@ 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' ); +is( $a->meta->foo, 'i am foo', '... foo method returns expected value' ); ok( MyClass->meta->meta->does_role('MyRole'), 'metaclass does MyRole' ); +is( MyClass->meta->foo, 'i am foo', '... foo method returns expected value' );