1use strict; 2use lib -e 't' ? 't' : 'test'; 3 4use TestBaseTest; 5 6if (-e 't') { 7 plan tests => 4; 8} 9else { 10 plan skip_all => "Dist test only"; 11} 12 13 14my $t = -e 't' ? 't' : 'test'; 15my $file = "$t/output/foo.txt"; 16 17ok not(-e $file), "$file doesn't already exist"; 18 19first_block; 20 21ok -e $file, "$file exists"; 22 23open my $fh, $file 24 or die "Can't open '$file' for input:\n$!"; 25is join('', <$fh>), 26 "One two\nBuckle my shoe\n", 27 '$file content is right'; 28 29is first_block->poem, $file, 'Returns file name'; 30 31__END__ 32 33=== 34--- poem write_file=t/output/foo.txt 35One two 36Buckle my shoe 37