blob: d9e80d3ef141bf5be64f511cf9b082b6eeee1eee [file] [log] [blame]
Akrond77eefe2024-08-26 14:01:09 +02001use strict;
2use warnings;
Akron6227fba2021-09-20 14:21:41 +02003use Test::Mojo;
4use Test::Output;
Akrond77eefe2024-08-26 14:01:09 +02005use Test::More;
6
7our %ENV;
8
Akron6227fba2021-09-20 14:21:41 +02009eval {
10 require KorAP::XML::Krill;
11 1;
12} || do {
13 plan skip_all => "KorAP::XML::Krill is not installed";
Akrond77eefe2024-08-26 14:01:09 +020014 exit;
Akron6227fba2021-09-20 14:21:41 +020015};
Akrond77eefe2024-08-26 14:01:09 +020016
Akron6227fba2021-09-20 14:21:41 +020017my $t = Test::Mojo->new(Kalamar => {
18 Kalamar => {
19 plugins => ['KorAPXML2Krill']
20 }
21});
Akrond77eefe2024-08-26 14:01:09 +020022
Akron6227fba2021-09-20 14:21:41 +020023my $app = $t->app;
24my $cmds = $app->commands;
Akrond77eefe2024-08-26 14:01:09 +020025
26use_ok('Method::Generate::DemolishAll');
27
Akron6227fba2021-09-20 14:21:41 +020028ok(grep/::KorAPXML2Krill/, @{$cmds->namespaces}, 'Namespace is set');
Akrond77eefe2024-08-26 14:01:09 +020029
Akron6227fba2021-09-20 14:21:41 +020030stdout_like(
31 sub {
32 $cmds->run('korapxml2krill','-v');
33 },
34 qr{\[archive\|extract\]}
35);
Akrond77eefe2024-08-26 14:01:09 +020036
37unless (grep { -x "$_/unzip"} split /:/, $ENV{PATH}) {
38 fail("unzip is not installed");
39};
40
41stdout_like(
42 sub {
43 return system('unzip','-v');
44 },
45 qr/UnZip/
46);
47
48
Akron6227fba2021-09-20 14:21:41 +020049done_testing;
Akrond77eefe2024-08-26 14:01:09 +020050__END__