6 use Test::More tests => 9;
8 use TAP::Parser::YAMLish::Writer;
14 " city: \"Royal Oak\"",
15 " lines: \"458 Walkman Dr.\\nSuite #292\\n\"",
20 "comments: \"Late afternoon is best. Backup contact is Nancy Billsmer \@ 338-4338\\n\"",
25 " description: Basketball",
30 " description: \"Super Hoop\"",
43 'city' => 'Royal Oak',
45 'lines' => "458 Walkman Dr.\nSuite #292\n",
51 'date' => '2001-01-23',
57 'description' => 'Basketball'
62 'description' => 'Super Hoop'
66 "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338\n",
75 { name => 'Array reference',
76 destination => \@buf1,
77 normalise => sub { return \@buf1 },
80 destination => sub { push @buf2, shift },
81 normalise => sub { return \@buf2 },
84 destination => \$buf3,
86 my @ar = split( /\n/, $buf3 );
92 for my $dest (@destination) {
93 my $name = $dest->{name};
94 ok my $yaml = TAP::Parser::YAMLish::Writer->new, "$name: Created";
95 isa_ok $yaml, 'TAP::Parser::YAMLish::Writer';
97 $yaml->write( $in, $dest->{destination} );
98 my $got = $dest->{normalise}->();
99 is_deeply $got, $out, "$name: Result matches";