summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-03-01 17:37:04 +0100
committerDaniel Friesel <derf@finalrewind.org>2011-03-01 17:37:04 +0100
commite4995e57f3bd978f10585890c671c613f6531c2e (patch)
treeb7b25d8bb913a4dffbadc5896ecb952a3b652981 /t
parent47f72633b8f571170718e2123c0e9066b4063d84 (diff)
App::Dthumb::Data: Exactly preserve text files, add test for it
Diffstat (limited to 't')
-rwxr-xr-xt/29-app-dthumb-data.t28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/29-app-dthumb-data.t b/t/29-app-dthumb-data.t
new file mode 100755
index 0000000..42e9b41
--- /dev/null
+++ b/t/29-app-dthumb-data.t
@@ -0,0 +1,28 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use 5.010;
+use autodie;
+
+use App::Dthumb::Data;
+use Test::More;
+
+opendir(my $share, 'share');
+my @files = grep { /^[^.]/ } readdir($share);
+closedir($share);
+
+plan(
+ tests => 1 + scalar @files,
+);
+
+my $dthumb = App::Dthumb::Data->new();
+
+isa_ok($dthumb, 'App::Dthumb::Data', 'App::Dthumb::Data->new()');
+
+for my $file (@files) {
+ open(my $fh, '<', "share/${file}");
+ my $data = do { local $/ = undef; <$fh> };
+ close($fh);
+
+ is($dthumb->get($file), $data, "\$dthumb->get($file)");
+}