update for v0.04
[DataExtract-FixedWidth.git] / t / 06-BadConstructor.t
blobf633492e7bf3584d44ac276805374e8f94870dad
1 #!/usr/bin/env perl
2 ## Example from http://en.wikipedia.org/w/index.php?title=Flat_file_database&oldid=209112999
3 ## Default options with column header name deduction
4 use strict;
5 use warnings;
7 use feature ':5.10';
9 use Test::More tests => 2;
10 use DataExtract::FixedWidth;
13 eval {
14 my $de = DataExtract::FixedWidth->new({
15 cols => [qw/foo bar baz/]
16 });
18 like ( $@, qr/You must.*header_row/, 'cols only');
19 undef $@;
23 eval {
24 my $de = DataExtract::FixedWidth->new;
26 say "bar $@";
27 like ( $@, qr/You must/, 'nothing only');