Fix test
[app-lastmsg.git] / t / App-Lastmsg.t
CommitLineData
82af6c12
MG
1#!/usr/bin/perl
2use strict;
3use warnings;
4
5use Test::More tests => 2;
6BEGIN { use_ok('App::Lastmsg') };
7
8my $real_strftime = \&POSIX::strftime;
9
10{
11 no warnings 'redefine';
636bd918 12 *App::Lastmsg::strftime = sub {
82af6c12
MG
13 my ($format, @rest) = @_;
14 $real_strftime->('%s', @rest)
15 };
16}
17
18chdir 't';
19my $out = '';
20open my $fh, '>', \$out or die "$!";
21$App::Lastmsg::OUTPUT_FILEHANDLE = $fh;
22$0 = 'lastmsg';
23App::Lastmsg::run;
24
25is $out, <<'EOF', 'output is correct';
636bd918
MG
26user2 user2@example.org 1483182600
27user1 user1@example.com 1483105440
82af6c12
MG
28user3 NOT FOUND
29EOF
This page took 0.010777 seconds and 4 git commands to generate.