fix for prototype undecl issue when type constraint utils loaded before consumers...
[gitmo/Moose.git] / t / 202_example_Moose_POOP.t
index b68c680..1c3c4bc 100644 (file)
@@ -6,8 +6,12 @@ use warnings;
 use Test::More;
 
 BEGIN {
-    eval "use DBM::Deep;";
-    plan skip_all => "DBM::Deep required for this test" if $@;        
+    eval "use DBM::Deep 0.983;";
+    plan skip_all => "DBM::Deep is required for this test" if $@;        
+    plan skip_all => "DBM::Deep (>= 1.0) is required for this test" 
+        if DBM::Deep->VERSION >= 1.0;        
+    eval "use DateTime::Format::MySQL;";
+    plan skip_all => "DateTime::Format::MySQL is required for this test" if $@;            
     plan tests => 89;    
 }
 
@@ -30,8 +34,6 @@ of concept of the flexibility of the ::Instance protocol.
 BEGIN {
     
     package Moose::POOP::Meta::Instance;
-    use strict;
-    use warnings;
     use Moose;
     
     use DBM::Deep;
@@ -60,7 +62,7 @@ BEGIN {
         
         sub create_instance {
             my $self  = shift;
-            my $class = $self->{meta}->name;
+            my $class = $self->associated_metaclass->name;
             my $oid   = ++$INSTANCE_COUNTERS{$class};
             
             $db->{$class}->[($oid - 1)] = {};
@@ -73,7 +75,7 @@ BEGIN {
         
         sub find_instance {
             my ($self, $oid) = @_;
-            my $instance = $db->{$self->{meta}->name}->[($oid - 1)];  
+            my $instance = $db->{$self->associated_metaclass->name}->[($oid - 1)];  
             $self->bless_instance_structure({
                 oid      => $oid,
                 instance => $instance
@@ -116,7 +118,7 @@ BEGIN {
     }
 
     sub weaken_slot_value {
-        confess "Not sure how well DBM::Deep plays with weak refs, Rob says 'Writer a test'";
+        confess "Not sure how well DBM::Deep plays with weak refs, Rob says 'Write a test'";
     }  
     
     sub inline_slot_access {
@@ -125,9 +127,7 @@ BEGIN {
     }
     
     package Moose::POOP::Meta::Class;
-    use strict;
-    use warnings;
-    use Moose;
+    use Moose;  
     
     extends 'Moose::Meta::Class';    
     
@@ -141,10 +141,8 @@ BEGIN {
 }
 {   
     package Moose::POOP::Object;
-    use strict;
-    use warnings;
     use metaclass 'Moose::POOP::Meta::Class' => (
-        ':instance_metaclass' => 'Moose::POOP::Meta::Instance'
+        instance_metaclass => 'Moose::POOP::Meta::Instance'
     );      
     use Moose;
     
@@ -158,8 +156,6 @@ BEGIN {
 }
 {    
     package Newswriter::Author;
-    use strict;
-    use warnings;   
     use Moose;
     
     extends 'Moose::POOP::Object';
@@ -168,8 +164,6 @@ BEGIN {
     has 'last_name'  => (is => 'rw', isa => 'Str');    
     
     package Newswriter::Article;    
-    use strict;
-    use warnings;
     use Moose;
     use Moose::Util::TypeConstraints;