summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-05-18 07:57:43 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-05-18 07:57:43 +0200
commit556ea57a7ce1e072f5360c00f5cef2406dff794f (patch)
tree4cda023b4f68231152af6d88690cb1725ee2ae91 /t
parent50a6957d835c06553b4d57212f23f0ed119a3df2 (diff)
Increase Test Coverage
Diffstat (limited to 't')
-rw-r--r--t/29-app-hashl.t15
1 files changed, 14 insertions, 1 deletions
diff --git a/t/29-app-hashl.t b/t/29-app-hashl.t
index 20d0734..c14aca1 100644
--- a/t/29-app-hashl.t
+++ b/t/29-app-hashl.t
@@ -3,7 +3,7 @@ use strict;
use warnings;
use 5.010;
-use Test::More tests => 22;
+use Test::More tests => 28;
use_ok('App::Hashl');
@@ -48,11 +48,24 @@ is_deeply($hashl->file('t/in/4'),
ok($hashl->file_in_db('t/in/4'), 'file is now in db');
ok($hashl->hash_in_db($test_hash), 'hash is in db');
+ok($hashl->add_file(
+ file => 't/in/1k',
+ path => 't/in/1k',
+ ),
+ 'Add another file'
+);
+is_deeply([$hashl->files()], [qw[t/in/1k t/in/4]], 'Both files in list');
+ok($hashl->file_in_db('t/in/1k'), 'file in db');
+ok($hashl->file_in_db('t/in/4'), 'other file in db');
+
ok($hashl->ignore('t/in/4', 't/in/4'), 'ignore file');
is($hashl->file_in_db('t/in/4'), $IGNORED, 'file no longer in db');
is_deeply([$hashl->ignored()], [$test_hash], 'file is ignored');
+ok($hashl->ignore('t/in/1k', 't/in/1k'), 'ignore other file as well');
+is($hashl->file_in_db('t/in/1k'), $IGNORED, 'file ignored');
+
ok($hashl->save('t/in/hashl.db'), 'save db');
undef $hashl;