Akron | e2b902d | 2016-08-16 16:50:11 +0200 | [diff] [blame] | 1 | #/usr/bin/env perl |
| 2 | use strict; |
| 3 | use warnings; |
| 4 | use File::Basename 'dirname'; |
| 5 | use File::Spec::Functions qw/catdir catfile/; |
| 6 | use File::Temp qw/ :POSIX /; |
Akron | 5fd2d8e | 2017-06-19 15:29:39 +0200 | [diff] [blame^] | 7 | use Mojo::File; |
Akron | e2b902d | 2016-08-16 16:50:11 +0200 | [diff] [blame] | 8 | use Mojo::JSON qw/decode_json/; |
| 9 | use IO::Uncompress::Gunzip; |
| 10 | use Test::More; |
| 11 | use Test::Output; |
| 12 | use Data::Dumper; |
| 13 | |
| 14 | my $f = dirname(__FILE__); |
| 15 | my $script = catfile($f, '..', '..', 'script', 'korapxml2krill'); |
| 16 | ok(-f $script, 'Script found'); |
| 17 | |
| 18 | stdout_like( |
| 19 | sub { system('perl', $script) }, |
| 20 | qr!Usage.+?korapxml2krill!s, |
| 21 | 'Usage output' |
| 22 | ); |
| 23 | |
| 24 | stdout_like( |
| 25 | sub { system('perl', $script, '--help') }, |
| 26 | qr!Usage.+?korapxml2krill!s, |
| 27 | 'Usage output' |
| 28 | ); |
| 29 | |
| 30 | stdout_like( |
| 31 | sub { system('perl', $script, '--version') }, |
| 32 | qr!Version \d+\.\d+!s, |
| 33 | 'Version output' |
| 34 | ); |
| 35 | |
| 36 | done_testing; |
| 37 | __END__ |