X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F102_InsideOutClass_test.t;h=615203d37bd973207fa4ca36592a50f58c7d4d47;hb=81c8a65bf02bb1b0e240d8f5b626b0ceabf9a37c;hp=4788dfc7eef14ac70a125284e0c75522c72a6e44;hpb=43715282bcc431ac51dc795d98ab3433a9893aaa;p=gitmo%2FClass-MOP.git diff --git a/t/102_InsideOutClass_test.t b/t/102_InsideOutClass_test.t index 4788dfc..615203d 100644 --- a/t/102_InsideOutClass_test.t +++ b/t/102_InsideOutClass_test.t @@ -3,8 +3,9 @@ use strict; use warnings; -use Test::More tests => 85; +use Test::More tests => 89; use File::Spec; +use Scalar::Util 'reftype'; BEGIN { use_ok('Class::MOP'); @@ -18,8 +19,8 @@ BEGIN { use warnings; use metaclass ( - ':attribute_metaclass' => 'InsideOutClass::Attribute', - ':instance_metaclass' => 'InsideOutClass::Instance' + 'attribute_metaclass' => 'InsideOutClass::Attribute', + 'instance_metaclass' => 'InsideOutClass::Instance' ); Foo->meta->add_attribute('foo' => ( @@ -55,8 +56,8 @@ BEGIN { use strict; use warnings; use metaclass ( - ':attribute_metaclass' => 'InsideOutClass::Attribute', - ':instance_metaclass' => 'InsideOutClass::Instance' + 'attribute_metaclass' => 'InsideOutClass::Attribute', + 'instance_metaclass' => 'InsideOutClass::Instance' ); Baz->meta->add_attribute('bling' => ( @@ -75,6 +76,8 @@ BEGIN { my $foo = Foo->new(); isa_ok($foo, 'Foo'); +is(reftype($foo), 'SCALAR', '... Foo is made with SCALAR'); + can_ok($foo, 'foo'); can_ok($foo, 'has_foo'); can_ok($foo, 'get_bar'); @@ -95,6 +98,8 @@ is($foo->get_bar(), 42, '... Foo::bar == 42'); my $foo2 = Foo->new(); isa_ok($foo2, 'Foo'); +is(reftype($foo2), 'SCALAR', '... Foo is made with SCALAR'); + ok(!$foo2->has_foo, '... Foo2::foo is not defined yet'); is($foo2->foo(), undef, '... Foo2::foo is not defined yet'); is($foo2->get_bar(), 'FOO is BAR', '... Foo2::bar has been initialized'); @@ -110,6 +115,8 @@ my $bar = Bar->new(); isa_ok($bar, 'Bar'); isa_ok($bar, 'Foo'); +is(reftype($bar), 'SCALAR', '... Bar is made with SCALAR'); + can_ok($bar, 'foo'); can_ok($bar, 'has_foo'); can_ok($bar, 'get_bar'); @@ -144,6 +151,8 @@ isa_ok($baz, 'Bar'); isa_ok($baz, 'Foo'); isa_ok($baz, 'Baz'); +is(reftype($baz), 'SCALAR', '... Bar::Baz is made with SCALAR'); + can_ok($baz, 'foo'); can_ok($baz, 'has_foo'); can_ok($baz, 'get_bar');