From 21fa4a13794515b3e2aa2c265564f4a6fd9ea097 Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Wed, 30 Dec 2015 17:42:56 -0800 Subject: [PATCH] getPublicAck: Additional die tests. --- Supporters/t/Supporters.t | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Supporters/t/Supporters.t b/Supporters/t/Supporters.t index 152ca8e..deaeab1 100644 --- a/Supporters/t/Supporters.t +++ b/Supporters/t/Supporters.t @@ -8,7 +8,7 @@ use strict; use warnings; -use Test::More tests => 227; +use Test::More tests => 229; use Test::Exception; use Sub::Override; use File::Temp qw/tempfile/; @@ -150,8 +150,14 @@ ok( (looks_like_number($sterlingId) and $sterlingId > $olsonId), =cut -dies_ok { my $ledgerId = $sp->getPublicAck(0); } - "getPublicAck: fails when rows are not returned but _verifyId() somehow passed"; +my $publicAckVal; + +dies_ok { $publicAckVal = $sp->getPublicAck(0); } + "getPublicAck: fails supporterId invalid"; +dies_ok { $publicAckVal = $sp->getPublicAck("String"); } + "getPublicAck: fails supporterId is string"; +dies_ok { $publicAckVal = $sp->getPublicAck(undef); } + "getPublicAck: fails supporterId is undef"; # Replace _verifyId() to always return true @@ -160,7 +166,6 @@ dies_ok { my $ledgerId = $sp->getPublicAck(0); } "getPublicAck: fails when rows are not returned but _verifyId() somehow passed"; $overrideSub->restore; -my $publicAckVal; lives_ok { $publicAckVal = $sp->getPublicAck($olsonId); } "getPublicAck: lives when valid id is given for someone who does not want it...";