X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F010_basics%2F001_basic_class_setup.t;h=03db813eec1fc2f9d6ad8e73baac94f4c8d462d9;hb=61697425b329bc667185bb5b2f4be223f2be62c0;hp=00d709ce063a62c331ef69e08ca55b8aad2b894b;hpb=f4fce6c81b07df08698798d87f6e7c0080b639cc;p=gitmo%2FMoose.git diff --git a/t/010_basics/001_basic_class_setup.t b/t/010_basics/001_basic_class_setup.t index 00d709c..03db813 100644 --- a/t/010_basics/001_basic_class_setup.t +++ b/t/010_basics/001_basic_class_setup.t @@ -3,9 +3,8 @@ use strict; use warnings; -use Test::More tests => 22; -use Test::Exception; - +use Test::More; +use Test::Fatal; { @@ -20,13 +19,9 @@ isa_ok(Foo->meta, 'Moose::Meta::Class'); ok(Foo->meta->has_method('meta'), '... we got the &meta method'); ok(Foo->isa('Moose::Object'), '... Foo is automagically a Moose::Object'); -dies_ok { +isnt( exception { Foo->meta->has_method() -} '... has_method requires an arg'; - -dies_ok { - Foo->meta->has_method('') -} '... has_method requires an arg'; +}, undef, '... has_method requires an arg' ); can_ok('Foo', 'does'); @@ -42,3 +37,16 @@ foreach my $function (qw( ok(!Foo->meta->has_method($function), '... the meta does not treat "' . $function . '" as a method'); } +foreach my $import (qw( + blessed + try + catch + in_global_destruction +)) { + ok(!Moose::Object->can($import), "no namespace pollution in Moose::Object ($import)" ); + + local $TODO = $import eq 'blessed' ? "no automatic namespace cleaning yet" : undef; + ok(!Foo->can($import), "no namespace pollution in Moose::Object ($import)" ); +} + +done_testing;