Akron | d77eefe | 2024-08-26 14:01:09 +0200 | [diff] [blame^] | 1 | use strict; |
2 | use warnings; | ||||
Akron | 6227fba | 2021-09-20 14:21:41 +0200 | [diff] [blame] | 3 | use Test::Mojo; |
4 | use Test::Output; | ||||
Akron | d77eefe | 2024-08-26 14:01:09 +0200 | [diff] [blame^] | 5 | use Test::More; |
6 | |||||
7 | our %ENV; | ||||
8 | |||||
Akron | 6227fba | 2021-09-20 14:21:41 +0200 | [diff] [blame] | 9 | eval { |
10 | require KorAP::XML::Krill; | ||||
11 | 1; | ||||
12 | } || do { | ||||
13 | plan skip_all => "KorAP::XML::Krill is not installed"; | ||||
Akron | d77eefe | 2024-08-26 14:01:09 +0200 | [diff] [blame^] | 14 | exit; |
Akron | 6227fba | 2021-09-20 14:21:41 +0200 | [diff] [blame] | 15 | }; |
Akron | d77eefe | 2024-08-26 14:01:09 +0200 | [diff] [blame^] | 16 | |
Akron | 6227fba | 2021-09-20 14:21:41 +0200 | [diff] [blame] | 17 | my $t = Test::Mojo->new(Kalamar => { |
18 | Kalamar => { | ||||
19 | plugins => ['KorAPXML2Krill'] | ||||
20 | } | ||||
21 | }); | ||||
Akron | d77eefe | 2024-08-26 14:01:09 +0200 | [diff] [blame^] | 22 | |
Akron | 6227fba | 2021-09-20 14:21:41 +0200 | [diff] [blame] | 23 | my $app = $t->app; |
24 | my $cmds = $app->commands; | ||||
Akron | d77eefe | 2024-08-26 14:01:09 +0200 | [diff] [blame^] | 25 | |
26 | use_ok('Method::Generate::DemolishAll'); | ||||
27 | |||||
Akron | 6227fba | 2021-09-20 14:21:41 +0200 | [diff] [blame] | 28 | ok(grep/::KorAPXML2Krill/, @{$cmds->namespaces}, 'Namespace is set'); |
Akron | d77eefe | 2024-08-26 14:01:09 +0200 | [diff] [blame^] | 29 | |
Akron | 6227fba | 2021-09-20 14:21:41 +0200 | [diff] [blame] | 30 | stdout_like( |
31 | sub { | ||||
32 | $cmds->run('korapxml2krill','-v'); | ||||
33 | }, | ||||
34 | qr{\[archive\|extract\]} | ||||
35 | ); | ||||
Akron | d77eefe | 2024-08-26 14:01:09 +0200 | [diff] [blame^] | 36 | |
37 | unless (grep { -x "$_/unzip"} split /:/, $ENV{PATH}) { | ||||
38 | fail("unzip is not installed"); | ||||
39 | }; | ||||
40 | |||||
41 | stdout_like( | ||||
42 | sub { | ||||
43 | return system('unzip','-v'); | ||||
44 | }, | ||||
45 | qr/UnZip/ | ||||
46 | ); | ||||
47 | |||||
48 | |||||
Akron | 6227fba | 2021-09-20 14:21:41 +0200 | [diff] [blame] | 49 | done_testing; |
Akron | d77eefe | 2024-08-26 14:01:09 +0200 | [diff] [blame^] | 50 | __END__ |