stringify version before comparing, as recommended by Zefram
[p5sagit/Try-Tiny.git] / t / global_destruction_load.t
CommitLineData
ed5dea68 1use strict;
2use warnings;
3use Test::More;
4
5BEGIN {
364c5e8f 6 plan skip_all => 'Capture::Tiny 0.12 required'
7 unless eval { require Capture::Tiny; Capture::Tiny->VERSION(0.12); 1 };
ed5dea68 8 plan tests => 3;
9 Capture::Tiny->import(qw(capture_stderr));
10}
11
12for 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}