diff options
Diffstat (limited to 't')
-rwxr-xr-x | t/20-app-dthumb.t | 4 | ||||
-rwxr-xr-x | t/21-app-dthumb.files.t | 23 | ||||
-rw-r--r-- | t/cmp/index.names | 4 | ||||
-rw-r--r-- | t/cmp/index.no-names | 4 | ||||
-rw-r--r-- | t/out/.thumbnails/invalid.png (renamed from t/imgdir/.thumbs/invalid.png) | 0 | ||||
-rw-r--r-- | t/out/no_image (renamed from t/imgdir/no_image) | 0 | ||||
-rw-r--r-- | t/out/one.png (renamed from t/imgdir/one.png) | bin | 6525 -> 6525 bytes | |||
-rw-r--r-- | t/out/two.png (renamed from t/imgdir/two.png) | bin | 13552 -> 13552 bytes |
8 files changed, 18 insertions, 17 deletions
diff --git a/t/20-app-dthumb.t b/t/20-app-dthumb.t index 9be60de..74288a8 100755 --- a/t/20-app-dthumb.t +++ b/t/20-app-dthumb.t @@ -16,8 +16,8 @@ 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}->{suffix_thumbs}, '.thumbnails', + 'Thumbnail suffix is .thumbnails'); is($dthumb->{config}->{file_index}, 'index.html', 'index is index.html'); is($dthumb->{config}->{names} , 1, 'Show image names'); diff --git a/t/21-app-dthumb.files.t b/t/21-app-dthumb.files.t index 7c91580..60283a6 100755 --- a/t/21-app-dthumb.files.t +++ b/t/21-app-dthumb.files.t @@ -14,8 +14,8 @@ plan tests => 9; use_ok('App::Dthumb'); my %conf = ( - file_index => 't/out/index', - dir_images => 't/imgdir', + file_index => 'index', + dir_images => 't/out', ); my @created_files; my @indep_files = ('main.css'); @@ -23,10 +23,10 @@ my @indep_files = ('main.css'); my $dthumb = App::Dthumb->new(%conf); isa_ok($dthumb, 'App::Dthumb'); -mkdir('t/out'); +$dthumb->read_directories; for my $file (qw(one.png two.png)) { - $dthumb->create_thumbnail_html($file); + $dthumb->create_thumbnail_html("t/out/$file"); } $dthumb->write_out_html(); @@ -40,8 +40,10 @@ unlink('t/out/index'); $conf{names} = 0; $dthumb = App::Dthumb->new(%conf); +$dthumb->read_directories; + for my $file (qw(one.png two.png)) { - $dthumb->create_thumbnail_html($file); + $dthumb->create_thumbnail_html("t/out/$file"); } $dthumb->write_out_html(); @@ -53,9 +55,10 @@ unlink('t/out/index'); $dthumb = App::Dthumb->new(dir_images => 't/out'); -$dthumb->create_files(); +$dthumb->read_directories; +$dthumb->create_files; -ok(-d 't/out/.thumbs', 'create_files: Creates thumb dir'); +ok(-d 't/out/.thumbnails', 'create_files: Creates thumb dir'); ok(-d 't/out/.dthumb', 'create_files: Creates data dir'); for my $file ($dthumb->{data}->list_archived()) { @@ -64,11 +67,9 @@ for my $file ($dthumb->{data}->list_archived()) { unlink("t/out/.dthumb/${file}"); } } -rmdir('t/out/.thumbs'); rmdir('t/out/.dthumb/css'); rmdir('t/out/.dthumb/js'); rmdir('t/out/.dthumb'); -rmdir('t/out'); is_deeply([sort $dthumb->{data}->list_archived()], [sort @created_files], 'create_files: All files created'); @@ -78,5 +79,5 @@ $dthumb = App::Dthumb->new(%conf); $dthumb->read_directories(); -is_deeply($dthumb->{old_thumbnails}, ['invalid.png'], '{old_thumbnails}'); -is_deeply($dthumb->{files}, ['one.png', 'two.png'], '{files}'); +is_deeply($dthumb->{old_thumbnails}, ['t/out/invalid.png'], '{old_thumbnails}'); +is_deeply($dthumb->{files}, ['t/out/one.png', 't/out/two.png'], '{files}'); diff --git a/t/cmp/index.names b/t/cmp/index.names index d714ab5..fcfb547 100644 --- a/t/cmp/index.names +++ b/t/cmp/index.names @@ -18,13 +18,13 @@ <body><div> <div class="image-container"> <a class="fancybox" href="one.png" title="one.png" data-fancybox-group="gallery"> - <img src="t/imgdir/.thumbs/one.png" alt="one.png" /></a> + <img src=".thumbnails/one.png" alt="one.png" /></a> <br /> <a style="text-decoration: none;" href="one.png">one.png</a> </div> <div class="image-container"> <a class="fancybox" href="two.png" title="two.png" data-fancybox-group="gallery"> - <img src="t/imgdir/.thumbs/two.png" alt="two.png" /></a> + <img src=".thumbnails/two.png" alt="two.png" /></a> <br /> <a style="text-decoration: none;" href="two.png">two.png</a> </div> diff --git a/t/cmp/index.no-names b/t/cmp/index.no-names index e1e9e2c..9689b00 100644 --- a/t/cmp/index.no-names +++ b/t/cmp/index.no-names @@ -18,11 +18,11 @@ <body><div> <div class="image-container"> <a class="fancybox" href="one.png" title="one.png" data-fancybox-group="gallery"> - <img src="t/imgdir/.thumbs/one.png" alt="one.png" /></a> + <img src=".thumbnails/one.png" alt="one.png" /></a> </div> <div class="image-container"> <a class="fancybox" href="two.png" title="two.png" data-fancybox-group="gallery"> - <img src="t/imgdir/.thumbs/two.png" alt="two.png" /></a> + <img src=".thumbnails/two.png" alt="two.png" /></a> </div> </div> </body> diff --git a/t/imgdir/.thumbs/invalid.png b/t/out/.thumbnails/invalid.png index e69de29..e69de29 100644 --- a/t/imgdir/.thumbs/invalid.png +++ b/t/out/.thumbnails/invalid.png diff --git a/t/imgdir/no_image b/t/out/no_image index e69de29..e69de29 100644 --- a/t/imgdir/no_image +++ b/t/out/no_image diff --git a/t/imgdir/one.png b/t/out/one.png Binary files differindex 5903c34..5903c34 100644 --- a/t/imgdir/one.png +++ b/t/out/one.png diff --git a/t/imgdir/two.png b/t/out/two.png Binary files differindex f16d150..f16d150 100644 --- a/t/imgdir/two.png +++ b/t/out/two.png |