X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F02-close-over.t;h=4b0e06a4c45c564074c26d0e541784c31e7ebc2c;hb=f3c276587bcc908113045cda767c9d40bdf497d4;hp=ea6792a535c2b6965aaa6c714b941ec6cf0b1b81;hpb=409b8f4169b1febda0f36fa7eb66abd79624ada7;p=gitmo%2FEval-Closure.git diff --git a/t/02-close-over.t b/t/02-close-over.t index ea6792a..4b0e06a 100644 --- a/t/02-close-over.t +++ b/t/02-close-over.t @@ -2,6 +2,7 @@ use strict; use warnings; use Test::More; +use Test::Exception; use Eval::Closure; @@ -33,16 +34,15 @@ use Test::Requires 'PadWalker'; } { - local $TODO = "we still have to close over \$__captures"; my $foo = []; my $env = { '$foo' => \$foo }; - my $code = eval_closure( - source => 'sub { push @$foo, @_; return $__captures }', - environment => $env, - ); - is_deeply(scalar(PadWalker::closed_over($code)), $env, - "closed over the right things"); + throws_ok { + my $code = eval_closure( + source => 'sub { push @$foo, @_; return $__captures }', + environment => $env, + ); + } qr/Global symbol "\$__captures/, "we don't close over \$__captures"; } # it'd be nice if we could test that closing over other things wasn't possible,