X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F108_ArrayBasedStorage_test.t;h=58ff1d45769ce418d7871ab2f2ba213ad0f918c8;hb=5e5102f19ccb1dc52b290577b0363e97dacbd5b3;hp=43e079f337180864ddae669f93b6c44c4f56c482;hpb=8d2d4c6705a3781606464d003a3641d835a35815;p=gitmo%2FClass-MOP.git diff --git a/t/108_ArrayBasedStorage_test.t b/t/108_ArrayBasedStorage_test.t index 43e079f..58ff1d4 100644 --- a/t/108_ArrayBasedStorage_test.t +++ b/t/108_ArrayBasedStorage_test.t @@ -1,15 +1,13 @@ -#!/usr/bin/perl - use strict; use warnings; -use Test::More tests => 72; +use Test::More; use File::Spec; use Scalar::Util 'reftype'; +use Class::MOP; BEGIN { - use_ok('Class::MOP'); - require_ok(File::Spec->catdir('examples', 'ArrayBasedStorage.pod')); + require_ok(File::Spec->catfile('examples', 'ArrayBasedStorage.pod')); } { @@ -39,6 +37,9 @@ BEGIN { } package Bar; + use metaclass ( + 'instance_metaclass' => 'ArrayBasedStorage::Instance', + ); use strict; use warnings; @@ -51,6 +52,9 @@ BEGIN { )); package Baz; + use metaclass ( + 'instance_metaclass' => 'ArrayBasedStorage::Instance', + ); use strict; use warnings; @@ -64,6 +68,9 @@ BEGIN { )); package Bar::Baz; + use metaclass ( + 'instance_metaclass' => 'ArrayBasedStorage::Instance', + ); use strict; use warnings; @@ -188,4 +195,10 @@ is($baz->foo(), 'This is Bar::Baz::foo', '... Bar::Baz::foo == "This is Bar"'); is($baz->get_bar(), 'FOO is BAR', '... Bar::Baz::bar has been initialized'); is($baz->bling(), 'Baz::bling', '... Bar::Baz::bling has been initialized'); +Foo->meta->add_attribute( forgotten => is => "rw" ); + +my $new_baz = Bar::Baz->new; + +cmp_ok( scalar(@$new_baz), ">", scalar(@$baz), "additional slot due to refreshed meta instance" ); +done_testing;