basic comment store code
[scpubgit/Commentry.git] / t / comment_store.t
1 use strictures 1;
2 use Test::More;
3 use aliased 'App::Commentry::CommentStore';
4 use aliased 'App::Commentry::Comment';
5
6 my $store = CommentStore->new(base_dir => 't/var/exstore');
7
8 is_deeply(
9   [ $store->get({ path => 'not/there' })->flatten ],
10   [], 'Nonexistent set is empty'
11 );
12
13 is_deeply(
14   [ $store->get({ path => 'one/two/three' })->flatten ],
15   [ map Comment->new({ title => "Title $_", body => "Body $_" }), 1, 2 ],
16   'Existing set loads ok'
17 );
18
19 done_testing;