diff options
Diffstat (limited to 't/100Push.t')
-rw-r--r-- | t/100Push.t | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/t/100Push.t b/t/100Push.t new file mode 100644 index 000000000..a4352ee5d --- /dev/null +++ b/t/100Push.t @@ -0,0 +1,51 @@ + +use 5.10.1; +use strict; +use warnings; +use lib qw(. lib t); + +use Test::More tests => 12; +use Capture::Tiny ':all'; + +delete @::ENV{'PATH', 'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; +$ENV{'PATH'} = ''; + +my $popts = "-I. -Ilib "; +$popts .= $ENV{'HARNESS_PERL_SWITCHES'} if ($ENV{'HARNESS_PERL_SWITCHES'}); + +my ($stdout, $stderr, $exit); + +($stdout, $stderr, $exit) = capture { + system( + "PROJECT=tests $^X $popts ./extensions/Push/bin/bugzilla-pushd.pl -f onepass"); +}; +diag($@) if ($@); +like($stderr, qr{Starting up}, "start pushd stderr"); +like($stdout, qr{Sending all queued messages}, "start pushd stdout"); +is($exit, 0, "start pushd exit"); + +($stdout, $stderr, $exit) = capture { + system( + "PROJECT=tests $^X $popts ./extensions/Push/bin/bugzilla-pushd.pl -d start"); +}; +is($stderr, "", "start pushd stderr"); +like($stdout, qr/Starting bugzilla-pushd.pl server/, "start pushd stdout"); +is($exit, 0, "start pushd exit"); + +($stdout, $stderr, $exit) = capture { + system( + "PROJECT=tests $^X $popts ./extensions/Push/bin/bugzilla-pushd.pl -d check"); +}; +diag($@) if ($@); +is($stderr, "", "check pushd stderr"); +like($stdout, qr{bugzilla-pushd.pl running}, "check pushd stdout"); +is($exit, 0, "check pushd exit"); + +($stdout, $stderr, $exit) = capture { + system( + "PROJECT=tests $^X $popts ./extensions/Push/bin/bugzilla-pushd.pl -d stop"); +}; +diag($@) if ($@); +is($stderr, "", "stop pushd stderr"); +like($stdout, qr/Process .* is gone/, "stop pushd stdout"); +is($exit, 0, "check pushd exit"); |