Commit | Line | Data |
bc1e29b5 |
1 | #!/usr/bin/perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
ef333f17 |
6 | use Test::More tests => 21; |
bc1e29b5 |
7 | use Test::Exception; |
8 | |
9 | BEGIN { |
10 | use_ok('Moose'); |
11 | } |
12 | |
13 | { |
14 | package Foo; |
15 | use Moose; |
05d9eaf6 |
16 | use Moose::Util::TypeConstraints; |
bc1e29b5 |
17 | } |
18 | |
19 | can_ok('Foo', 'meta'); |
20 | isa_ok(Foo->meta, 'Moose::Meta::Class'); |
21 | |
e522431d |
22 | ok(Foo->meta->has_method('meta'), '... we got the &meta method'); |
bc1e29b5 |
23 | ok(Foo->isa('Moose::Object'), '... Foo is automagically a Moose::Object'); |
24 | |
ef333f17 |
25 | can_ok('Foo', 'does'); |
26 | |
bc1e29b5 |
27 | foreach 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 | |