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