got rid of all the use_ok junk except for 000_load.t
[gitmo/Class-MOP.git] / t / 108_ArrayBasedStorage_test.t
index efedf25..9161f17 100644 (file)
@@ -7,8 +7,7 @@ use Test::More tests => 72;
 use File::Spec;
 use Scalar::Util 'reftype';
 
-BEGIN {
-    use_ok('Class::MOP');
+BEGIN {use Class::MOP;
     require_ok(File::Spec->catfile('examples', 'ArrayBasedStorage.pod'));
 }
 
@@ -39,6 +38,9 @@ BEGIN {
     }
 
     package Bar;
+    use metaclass (
+        'instance_metaclass'  => 'ArrayBasedStorage::Instance',
+    );
 
     use strict;
     use warnings;
@@ -51,6 +53,9 @@ BEGIN {
     ));
 
     package Baz;
+    use metaclass (
+        'instance_metaclass'  => 'ArrayBasedStorage::Instance',
+    );
 
     use strict;
     use warnings;
@@ -64,6 +69,9 @@ BEGIN {
     ));
 
     package Bar::Baz;
+    use metaclass (
+        'instance_metaclass'  => 'ArrayBasedStorage::Instance',
+    );
 
     use strict;
     use warnings;
@@ -188,4 +196,9 @@ 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" );