summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-03-04 09:12:13 +0100
committerDaniel Friesel <derf@finalrewind.org>2011-03-04 09:12:13 +0100
commitb7566742ffcf86c8a6d9fac0eace013e1ffd6d04 (patch)
tree5ee7366eb78c16aec3303a6eab39941dc595b777 /t
parent04d800589cc2bbb2e6a61969547179a8b20c837e (diff)
App::Dthumb read_directories() tests
Diffstat (limited to 't')
-rwxr-xr-xt/20-app-dthumb.t14
-rw-r--r--t/imgdir/.thumbs/invalid.png0
-rw-r--r--t/imgdir/one.pngbin0 -> 6525 bytes
-rw-r--r--t/imgdir/two.pngbin0 -> 13552 bytes
4 files changed, 13 insertions, 1 deletions
diff --git a/t/20-app-dthumb.t b/t/20-app-dthumb.t
index b591866..bb063e3 100755
--- a/t/20-app-dthumb.t
+++ b/t/20-app-dthumb.t
@@ -4,7 +4,7 @@ use warnings;
use 5.010;
use autodie;
-use Test::More tests => 13;
+use Test::More tests => 19;
use_ok('App::Dthumb');
@@ -14,6 +14,12 @@ isa_ok($dthumb, 'App::Dthumb');
isa_ok($dthumb->{data}, 'App::Dthumb::Data');
+is($dthumb->{config}->{dir_data}, './.dthumb', 'Data directory is .dthumb');
+is($dthumb->{config}->{dir_images}, '.', 'Image directory is .');
+is($dthumb->{config}->{dir_thumbs}, './.thumbs',
+ 'Thumbnail directory is dthumbs');
+is($dthumb->{config}->{file_index}, 'index.xhtml', 'index is index.xhtml');
+
is($dthumb->{config}->{lightbox}, 1, 'Lightbox enabled');
is($dthumb->{config}->{names} , 1, 'Show image names');
is($dthumb->{config}->{quality} , 75, 'Default quality');
@@ -34,3 +40,9 @@ $dthumb = App::Dthumb->new();
@{$dthumb->{old_thumbnails}} = 'e.png';
is_deeply($dthumb->{files}, [$dthumb->get_files()], '$dthumb->get_files()');
+
+$dthumb = App::Dthumb->new(dir_images => 't/imgdir');
+$dthumb->read_directories();
+
+is_deeply($dthumb->{old_thumbnails}, ['invalid.png'], '{old_thumbnails}');
+is_deeply($dthumb->{files}, ['one.png', 'two.png'], '{files}');
diff --git a/t/imgdir/.thumbs/invalid.png b/t/imgdir/.thumbs/invalid.png
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/t/imgdir/.thumbs/invalid.png
diff --git a/t/imgdir/one.png b/t/imgdir/one.png
new file mode 100644
index 0000000..5903c34
--- /dev/null
+++ b/t/imgdir/one.png
Binary files differ
diff --git a/t/imgdir/two.png b/t/imgdir/two.png
new file mode 100644
index 0000000..f16d150
--- /dev/null
+++ b/t/imgdir/two.png
Binary files differ