Support --quiet flag (fixes #15)
Change-Id: I2675131953f1ac455c85862278df9a702ad5d523
diff --git a/t/archive.t b/t/archive.t
index 71bedce..77026d7 100644
--- a/t/archive.t
+++ b/t/archive.t
@@ -6,6 +6,7 @@
use File::Basename 'dirname';
use File::Spec::Functions qw/catfile catdir/;
use File::Temp qw/tempdir/;
+use Test::Output qw/:stdout :stderr :functions/;
use KorAP::XML::Archive;
@@ -36,7 +37,12 @@
{
local $SIG{__WARN__} = sub {};
- ok($archive->extract_sigle(['TEST/BSP/8'], $dir), 'Wrong path');
+ my $stdout = stdout_from(
+ sub {
+ ok($archive->extract_sigle(0, ['TEST/BSP/8'], $dir), 'Wrong path');
+ }
+ );
+ like($stdout, qr!Extract unzip!);
};
ok(-d catdir($dir, 'TEST'), 'Test corpus directory exists');
@@ -64,9 +70,15 @@
{
local $SIG{__WARN__} = sub {};
- ok($archive->extract_sigle(['REI/RB*', 'REI/BNG/00071'], $dir), 'Fine');
+ my $stdout = stdout_from(
+ sub {
+ ok($archive->extract_sigle(1, ['REI/RB*', 'REI/BNG/00071'], $dir), 'Fine');
+ }
+ );
+ is($stdout, '');
};
+
ok(-d catdir($dir, 'REI'), 'Test corpus directory exists');
ok(-d catdir($dir, 'REI','BNG'), 'Test corpus directory exists');
ok(-d catdir($dir, 'REI','BNG','00071'), 'Test corpus directory exists');