From: Yuval Kogman Date: Thu, 17 Sep 2009 11:54:51 +0000 (+0300) Subject: Failing test for Moose::Object namespace pollution X-Git-Tag: 0.91~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2f5dbc0b197a65067b04d289f31cf1fb8345c62a;p=gitmo%2FMoose.git Failing test for Moose::Object namespace pollution Checks that Moose::object and derived classes don't pollute the method namespace with exports (regardless of whether or not there are meta method objects for these) --- diff --git a/t/010_basics/001_basic_class_setup.t b/t/010_basics/001_basic_class_setup.t index 00d709c..16ef006 100644 --- a/t/010_basics/001_basic_class_setup.t +++ b/t/010_basics/001_basic_class_setup.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 22; +use Test::More tests => 30; use Test::Exception; @@ -42,3 +42,14 @@ 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)" ); +}