Akron | b427992 | 2022-12-12 12:42:31 +0100 | [diff] [blame] | 1 | use Test::More; |
| 2 | use Test::Mojo; |
| 3 | use Test::Output; |
| 4 | |
| 5 | my $java = `sh -c 'command -v java'`; |
| 6 | chomp $java; |
| 7 | |
| 8 | if ($java eq '') { |
| 9 | plan skip_all => "Java is not installed"; |
| 10 | return; |
| 11 | }; |
| 12 | |
| 13 | unless ($ENV{KRILL_INDEXER_PATH}) { |
| 14 | plan skip_all => "Krill-Indexer is not installed"; |
| 15 | return; |
| 16 | }; |
| 17 | |
| 18 | my $t = Test::Mojo->new(Kalamar => { |
| 19 | Kalamar => { |
| 20 | plugins => ['KrillIndexer'] |
| 21 | } |
| 22 | }); |
| 23 | |
| 24 | my $app = $t->app; |
| 25 | |
| 26 | my $cmds = $app->commands; |
| 27 | |
| 28 | ok(grep/::KrillIndexer/, @{$cmds->namespaces}, 'Namespace is set'); |
| 29 | |
| 30 | stdout_like( |
| 31 | sub { |
| 32 | $cmds->run('krill-indexer'); |
| 33 | }, |
| 34 | qr{--inputDir} |
| 35 | ); |
| 36 | |
| 37 | done_testing; |
| 38 | |
| 39 | 1; |