3 use Test::More qw(no_plan);
7 use_ok aliased => 'IronMunger::PlaggerLoader';
10 my @names = ('Jess Robinson', 'Justin DeVuyst');
12 my @files = ('my_Jess_Robinson.csv', 'my_Justin_DeVuyst.csv');
14 ok(my $loader = PlaggerLoader->new(dir => 't/csv'), 'build loader');
16 my @target = $loader->_target_files;
18 cmp_ok(@target, '==', 2, '2 files in CSV directory');
21 [ sort map { ($_->splitpath)[-1] } @target ], \@files,
26 my %args = (url => 'http://foo.com', at => '2008-04-06T12:00:00');
28 ok(my $post = $loader->_expand_post(\%args), 'Expand post constructs object');
30 foreach my $key (sort keys %args) {
31 is($post->$key, $args{$key}, "Attribute ${key} ok");
37 url => 'http://jdv79.blogspot.com/2009/05/testable-v007.html',
39 }, qw(2009-05-13T02:45:00 2009-05-14T16:00:00);
41 my $specs = $loader->_expand_postspecs_from_file(
42 io('t/csv/my_Justin_DeVuyst.csv')
45 is_deeply($specs, \@postspecs, 'Post specs from file ok');