stupid-monkey
[gitmo/Moose.git] / t / 010_basic_class_setup.t
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use Test::More tests => 16;
7 use Test::Exception;
8
9 BEGIN {
10     use_ok('Moose');           
11 }
12
13 {
14     package Foo;
15     use Moose;
16 }
17
18 can_ok('Foo', 'meta');
19 isa_ok(Foo->meta, 'Moose::Meta::Class');
20
21 ok(!Foo->meta->has_method('meta'), '... we get the &meta method from Moose::Object');
22 ok(Foo->isa('Moose::Object'), '... Foo is automagically a Moose::Object');
23
24 foreach my $function (qw(
25                                                  extends
26                          has 
27                              before after around
28                              blessed confess
29                                                  type subtype as where
30                              )) {
31     ok(!Foo->meta->has_method($function), '... the meta does not treat "' . $function . '" as a method');
32 }
33