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