LP#1180849: test case - ignoring subrequest responses after respond_complete()
authorGalen Charlton <gmc@esilibrary.com>
Mon, 16 Dec 2013 16:08:51 +0000 (08:08 -0800)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 16 Dec 2013 16:08:51 +0000 (08:08 -0800)
This patch adds a regression test for verifying that subrequests
ignore additional responses after respond_complete() is called.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

src/perl/t/02-AppSession.t

index 01cce39..5a88b2c 100644 (file)
@@ -2,7 +2,7 @@
 
 use strict;
 use warnings;
-use Test::More tests => 3;
+use Test::More tests => 4;
 
 BEGIN {
        use_ok( 'OpenSRF::AppSession' );
@@ -12,3 +12,11 @@ my $locale = OpenSRF::AppSession->default_locale('fr-CA');
 is($locale, 'fr-CA', 'got back the default locale we set');
 $locale = OpenSRF::AppSession->reset_locale();
 is($locale, 'en-US', 'got back en-US after reset of default locale');
+
+my $subreq = OpenSRF::AppSubrequest->new();
+$subreq->respond('a');
+$subreq->respond('b');
+$subreq->respond_complete();
+$subreq->respond('c');
+my @responses = $subreq->responses();
+is_deeply(\@responses, ['a', 'b'], 'further responses ignored after respond_complete() is called');