diff options
author | Jesse Luehrs <doy@tozt.net> | 2010-10-31 16:24:41 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2010-10-31 16:24:41 -0500 |
commit | 01b68b64a3f85bdf4615d74d357a4e8735ead106 (patch) | |
tree | 84928d9da70adc3efb9a0a514c0962b53d66aede /t/02-close-over.t | |
parent | 53b0abc5127b2a28344d9c17caefefcbebbee11b (diff) | |
download | eval-closure-01b68b64a3f85bdf4615d74d357a4e8735ead106.tar.gz eval-closure-01b68b64a3f85bdf4615d74d357a4e8735ead106.zip |
convert to Test::Fatal
Diffstat (limited to 't/02-close-over.t')
-rw-r--r-- | t/02-close-over.t | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/t/02-close-over.t b/t/02-close-over.t index 4b0e06a..8a58aa3 100644 --- a/t/02-close-over.t +++ b/t/02-close-over.t @@ -2,7 +2,7 @@ use strict; use warnings; use Test::More; -use Test::Exception; +use Test::Fatal; use Eval::Closure; @@ -37,12 +37,16 @@ use Test::Requires 'PadWalker'; my $foo = []; my $env = { '$foo' => \$foo }; - throws_ok { - my $code = eval_closure( - source => 'sub { push @$foo, @_; return $__captures }', - environment => $env, - ); - } qr/Global symbol "\$__captures/, "we don't close over \$__captures"; + like( + exception { + 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, |