Regenerate test files
[gitmo/Mouse.git] / t / 010_basics / 001_basic_class_setup.t
CommitLineData
60ad2cb7 1#!/usr/bin/perl
fde8e43f 2# This is automatically generated by author/import-moose-test.pl.
3# DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4use t::lib::MooseCompat;
60ad2cb7 5
6use strict;
7use warnings;
8
fde8e43f 9use Test::More;
60ad2cb7 10use Test::Exception;
11
12
60ad2cb7 13{
14 package Foo;
15 use Mouse;
16 use Mouse::Util::TypeConstraints;
17}
18
19can_ok('Foo', 'meta');
20isa_ok(Foo->meta, 'Mouse::Meta::Class');
21
22ok(Foo->meta->has_method('meta'), '... we got the &meta method');
23ok(Foo->isa('Mouse::Object'), '... Foo is automagically a Mouse::Object');
24
25dies_ok {
26 Foo->meta->has_method()
27} '... has_method requires an arg';
28
29can_ok('Foo', 'does');
30
31foreach 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
43foreach 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}
fde8e43f 54
55done_testing;