From: Dave Rolsky Date: Wed, 3 Sep 2008 16:55:16 +0000 (+0000) Subject: We need the evals here to force this stuff to happen at run time, but X-Git-Tag: 0.57~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1f10147d9e0ca9654b2c209dc222644ca1e4a4a9;p=gitmo%2FMoose.git We need the evals here to force this stuff to happen at run time, but we should just do if the eval fails. --- diff --git a/t/010_basics/009_import_unimport.t b/t/010_basics/009_import_unimport.t index 7ff0c60..7aef23a 100644 --- a/t/010_basics/009_import_unimport.t +++ b/t/010_basics/009_import_unimport.t @@ -19,14 +19,17 @@ my @moose_exports = qw( { package Foo; - use Moose; + eval 'use Moose'; + die $@ if $@; } can_ok('Foo', $_) for @moose_exports; { package Foo; - no Moose; + + eval 'no Moose'; + die $@ if $@; } ok(!Foo->can($_), '... Foo can no longer do ' . $_) for @moose_exports; @@ -43,14 +46,17 @@ my @moose_type_constraint_exports = qw( { package Bar; - use Moose::Util::TypeConstraints; + eval 'use Moose::Util::TypeConstraints'; + die $@ if $@; } can_ok('Bar', $_) for @moose_type_constraint_exports; { package Bar; - no Moose::Util::TypeConstraints; + + eval 'no Moose::Util::TypeConstraints'; + die $@ if $@; } ok(!Bar->can($_), '... Bar can no longer do ' . $_) for @moose_type_constraint_exports;