Commit | Line | Data |
ed5dea68 |
1 | use strict; |
2 | use warnings; |
3 | use Test::More; |
4 | |
5 | BEGIN { |
6 | plan skip_all => 'Capture::Tiny required' |
7 | unless eval { require Capture::Tiny; 1 }; |
8 | plan tests => 3; |
9 | Capture::Tiny->import(qw(capture_stderr)); |
10 | } |
11 | |
12 | for my $func (qw(try catch finally)) { |
13 | is capture_stderr { |
14 | system $^X, qw(-It/lib -we), |
15 | qq{sub DESTROY { require TryUser; TryUser->test_$func }} . |
16 | q{our $o; $o = bless []}; |
17 | }, '', "$func gets installed when loading Try::Tiny during global destruction"; |
18 | } |