diff --git a/t/02-init.t b/t/02-init.t index 93fe4f186f5e13ecca70cf3b12fa77ed43d73ba9..18c6aef45bb51e54fc746886b47cb4b7240b3e81 100644 --- a/t/02-init.t +++ b/t/02-init.t @@ -1,6 +1,6 @@ use v5.36; use Test::Cmd; -use Test::More tests =>10; +use Test::More tests =>19; use Path::Tiny; my $perl = $^X; my $testapp = Test::Cmd->new( @@ -24,13 +24,24 @@ use_ok("SLUB::LZA::TA::Crypt"); is(SLUB::LZA::TA::Crypt::encrypt("199fc76b9d086d8937976634e93413bcd005d941"), "839852bed005a7f1237578a6ac1197c142f7d0dd58bb248446dc7849d4bf770902e7f980ad83d39008ad638bc41e2345", "ta-tool, init, check encryption"); is(SLUB::LZA::TA::Crypt::decrypt("839852bed005a7f1237578a6ac1197c142f7d0dd58bb248446dc7849d4bf770902e7f980ad83d39008ad638bc41e2345"), "199fc76b9d086d8937976634e93413bcd005d941", "ta-tool, init, check encryption"); ok($testapp, "init 'ta-tool'"); +foreach my $param ("help init", "init -h", "init --help") { + $testapp->run(args => $param); + #say "STDOUT:",$testapp->stdout; + #say "STDERR:",$testapp->stderr; + like($testapp->stdout, qr/this usage screen/, "ta-tool $param, stdout"); + like($testapp->stderr, qr/^$/, "ta-tool $param, stderr"); + is($? >> 8, 0, "ta-tool $param, exit status"); +} + + $testapp->run( stdin => <<_EOF_, lza 199fc76b9d086d8937976634e93413bcd005d941 199fc76b9d086d8937976634e93413bcd005d941 _EOF_ - args => '-v init -e sdvlzaamtestfotothek01.slub-dresden.de -l /tmp', + args => 'init -v -e sdvlzaamtestfotothek01.slub-dresden.de', + #args => 'init -e sdvlzaamtestfotothek01.slub-dresden.de -l /tmp', ); #say "STDOUT:",$testapp->stdout; #say "STDERR:",$testapp->stderr; @@ -44,7 +55,6 @@ is($config, <<_EXP_, "ta-tool init, config file as expected"); elasticsearch_host: sdvlzaamtestfotothek01.slub-dresden.de elasticsearch_port: 9200 http_only: ~ -logdir: /tmp password: 839852bed005a7f1237578a6ac1197c142f7d0dd58bb248446dc7849d4bf770902e7f980ad83d39008ad638bc41e2345 user: lza _EXP_