merging the immutable branch into trunk
[gitmo/Class-MOP.git] / t / 108_ArrayBasedStorage_test.t
index faf4378..0757a61 100644 (file)
@@ -3,8 +3,9 @@
 use strict;
 use warnings;
 
-use Test::More tests => 65;
+use Test::More tests => 69;
 use File::Spec;
+use Scalar::Util 'reftype';
 
 BEGIN { 
     use_ok('Class::MOP');    
@@ -16,8 +17,8 @@ BEGIN {
     
     use strict;
     use warnings;    
-    use metaclass 'Class::MOP::Class' => (
-        ':instance_metaclass'  => 'ArrayBasedStorage::Instance',
+    use metaclass (
+        'instance_metaclass'  => 'ArrayBasedStorage::Instance',
     );
     
     Foo->meta->add_attribute('foo' => (
@@ -52,8 +53,8 @@ BEGIN {
     
     use strict;
     use warnings;
-    use metaclass 'Class::MOP::Class' => (
-        ':instance_metaclass'  => 'ArrayBasedStorage::Instance',
+    use metaclass (        
+        'instance_metaclass'  => 'ArrayBasedStorage::Instance',
     );
     
     Baz->meta->add_attribute('bling' => (
@@ -72,6 +73,8 @@ BEGIN {
 my $foo = Foo->new();
 isa_ok($foo, 'Foo');
 
+is(reftype($foo), 'ARRAY', '... Foo is made with ARRAY');
+
 can_ok($foo, 'foo');
 can_ok($foo, 'has_foo');
 can_ok($foo, 'get_bar');
@@ -92,6 +95,8 @@ is($foo->get_bar(), 42, '... Foo::bar == 42');
 my $foo2 = Foo->new();
 isa_ok($foo2, 'Foo');
 
+is(reftype($foo2), 'ARRAY', '... Foo is made with ARRAY');
+
 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');
@@ -107,6 +112,8 @@ my $bar = Bar->new();
 isa_ok($bar, 'Bar');
 isa_ok($bar, 'Foo');
 
+is(reftype($bar), 'ARRAY', '... Bar is made with ARRAY');
+
 can_ok($bar, 'foo');
 can_ok($bar, 'has_foo');
 can_ok($bar, 'get_bar');
@@ -141,6 +148,8 @@ isa_ok($baz, 'Bar');
 isa_ok($baz, 'Foo');
 isa_ok($baz, 'Baz');
 
+is(reftype($baz), 'ARRAY', '... Bar::Baz is made with ARRAY');
+
 can_ok($baz, 'foo');
 can_ok($baz, 'has_foo');
 can_ok($baz, 'get_bar');