Regenerate test files
[gitmo/Mouse.git] / t / 010_basics / 001_basic_class_setup.t
1 #!/usr/bin/perl
2 # This is automatically generated by author/import-moose-test.pl.
3 # DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4 use t::lib::MooseCompat;
5
6 use strict;
7 use warnings;
8
9 use Test::More;
10 use Test::Exception;
11
12
13 {
14     package Foo;
15     use Mouse;
16     use Mouse::Util::TypeConstraints;
17 }
18
19 can_ok('Foo', 'meta');
20 isa_ok(Foo->meta, 'Mouse::Meta::Class');
21
22 ok(Foo->meta->has_method('meta'), '... we got the &meta method');
23 ok(Foo->isa('Mouse::Object'), '... Foo is automagically a Mouse::Object');
24
25 dies_ok {
26    Foo->meta->has_method()
27 } '... has_method requires an arg';
28
29 can_ok('Foo', 'does');
30
31 foreach my $function (qw(
32                          extends
33                          has
34                          before after around
35                          blessed confess
36                          type subtype as where
37                          coerce from via
38                          find_type_constraint
39                          )) {
40     ok(!Foo->meta->has_method($function), '... the meta does not treat "' . $function . '" as a method');
41 }
42
43 foreach my $import (qw(
44     blessed
45     try
46     catch
47     in_global_destruction
48 )) {
49     ok(!Mouse::Object->can($import), "no namespace pollution in Mouse::Object ($import)" );
50
51     local $TODO = $import eq 'blessed' ? "no automatic namespace cleaning yet" : undef;
52     ok(!Foo->can($import), "no namespace pollution in Mouse::Object ($import)" );
53 }
54
55 done_testing;