1 package Test::Leaner::TestHelper;
9 sub capture_to_buffer {
10 return unless $] >= 5.008;
12 die "Can't call capture_to_buffer twice" if $memory_stream;
15 open $memory_stream, '>', $buf_ref
16 or die 'could not create the in-memory file';
18 Test::Leaner::tap_stream($memory_stream);
23 # The ";&" prototype does not work well with perl 5.6
24 sub reset_buffer (&) {
27 die "The memory stream has not been initialized" unless $memory_stream;
30 seek $memory_stream, 0, 0;
42 sub import { goto &Exporter::import }