fix for prototype undecl issue when type constraint utils loaded before consumers...
[gitmo/Moose.git] / t / 010_basic_class_setup.t
index e5fe63d..7647693 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 16;
+use Test::More tests => 23;
 use Test::Exception;
 
 BEGIN {
@@ -13,20 +13,33 @@ BEGIN {
 {
     package Foo;
     use Moose;
+    use Moose::Util::TypeConstraints;
 }
 
 can_ok('Foo', 'meta');
 isa_ok(Foo->meta, 'Moose::Meta::Class');
 
-ok(!Foo->meta->has_method('meta'), '... we get the &meta method from Moose::Object');
+ok(Foo->meta->has_method('meta'), '... we got the &meta method');
 ok(Foo->isa('Moose::Object'), '... Foo is automagically a Moose::Object');
 
+dies_ok {
+   Foo->meta->has_method() 
+} '... has_method requires an arg';
+
+dies_ok {
+   Foo->meta->has_method('') 
+} '... has_method requires an arg';
+
+can_ok('Foo', 'does');
+
 foreach my $function (qw(
                                                 extends
                         has 
                             before after around
                             blessed confess
                                                 type subtype as where
+                                                coerce from via
+                                                find_type_constraint
                             )) {
     ok(!Foo->meta->has_method($function), '... the meta does not treat "' . $function . '" as a method');
 }