From: Dave Rolsky Date: Wed, 3 Sep 2008 16:46:57 +0000 (+0000) Subject: All these evals do is hide when Moose or some other module has a syntax error. X-Git-Tag: 0.57~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dbdd0591d6ee2091120d1bba51c4535165fab139;p=gitmo%2FMoose.git All these evals do is hide when Moose or some other module has a syntax error. --- diff --git a/t/010_basics/009_import_unimport.t b/t/010_basics/009_import_unimport.t index 7e58c7c..7ff0c60 100644 --- a/t/010_basics/009_import_unimport.t +++ b/t/010_basics/009_import_unimport.t @@ -6,7 +6,6 @@ use warnings; use Test::More tests => 46; - my @moose_exports = qw( extends with has @@ -19,21 +18,16 @@ my @moose_exports = qw( { package Foo; -} -eval q{ - package Foo; use Moose; -}; -ok(!$@, '... Moose succesfully exported into Foo'); +} can_ok('Foo', $_) for @moose_exports; -eval q{ +{ package Foo; no Moose; -}; -ok(!$@, '... Moose succesfully un-exported from Foo'); +} ok(!Foo->can($_), '... Foo can no longer do ' . $_) for @moose_exports; @@ -48,21 +42,16 @@ my @moose_type_constraint_exports = qw( { package Bar; -} -eval q{ - package Bar; use Moose::Util::TypeConstraints; -}; -ok(!$@, '... Moose::Util::TypeConstraints succesfully exported into Bar'); +} can_ok('Bar', $_) for @moose_type_constraint_exports; -eval q{ +{ package Bar; no Moose::Util::TypeConstraints; -}; -ok(!$@, '... Moose::Util::TypeConstraints succesfully un-exported from Bar'); +} ok(!Bar->can($_), '... Bar can no longer do ' . $_) for @moose_type_constraint_exports;