bump version so Moose has something to depend on
[gitmo/Class-MOP.git] / t / 108_ArrayBasedStorage_test.t
index 43e079f..f47b010 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 
@@ -7,9 +5,8 @@ use Test::More tests => 72;
 use File::Spec;
 use Scalar::Util 'reftype';
 
-BEGIN {
-    use_ok('Class::MOP');
-    require_ok(File::Spec->catdir('examples', 'ArrayBasedStorage.pod'));
+BEGIN {use Class::MOP;
+    require_ok(File::Spec->catfile('examples', 'ArrayBasedStorage.pod'));
 }
 
 {
@@ -39,6 +36,9 @@ BEGIN {
     }
 
     package Bar;
+    use metaclass (
+        'instance_metaclass'  => 'ArrayBasedStorage::Instance',
+    );
 
     use strict;
     use warnings;
@@ -51,6 +51,9 @@ BEGIN {
     ));
 
     package Baz;
+    use metaclass (
+        'instance_metaclass'  => 'ArrayBasedStorage::Instance',
+    );
 
     use strict;
     use warnings;
@@ -64,6 +67,9 @@ BEGIN {
     ));
 
     package Bar::Baz;
+    use metaclass (
+        'instance_metaclass'  => 'ArrayBasedStorage::Instance',
+    );
 
     use strict;
     use warnings;
@@ -188,4 +194,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" );