Skip to content

Commit

Permalink
test --last-minutes 5
Browse files Browse the repository at this point in the history
  • Loading branch information
mdom committed Apr 27, 2014
1 parent ffca3de commit 6516a58
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Build.PL
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ my $builder = Module::Build->new(
'Pod::Usage' => 0,
},
test_requires => {
'Test::Output' => 0,
'Test::More' => 0,
'FindBin' => 0,
'Test::Output' => 0,
'Test::More' => 0,
'Test::MockTime' => 0,
'FindBin' => 0,
},
create_makefile_pl => 'traditional',
);
Expand Down
23 changes: 23 additions & 0 deletions t/03last-minutes.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/perl

use strict;
use warnings;
use Test::MockTime qw(set_absolute_time);
use Test::More;
use FindBin qw($Bin);
use lib "$Bin/lib";
use Test::Dategrep;

set_absolute_time(1395580908);

$ENV{DATEGREP_DEFAULT_FORMAT} = '%Y-%m-%d %H:%M';

test_dategrep [
'--last-minutes=5',"$Bin/files/test01.log"
],
<<'EOF', 'test --last-minutes 5';
2014-03-23 14:16 line 1
2014-03-23 14:17 line 1
EOF

done_testing();

0 comments on commit 6516a58

Please sign in to comment.