Bug 8524 follow-up: fix broken test
authorJared Camins-Esakov <jcamins@cpbibliography.com>
Thu, 9 Aug 2012 11:45:05 +0000 (07:45 -0400)
committerPaul Poulain <paul.poulain@biblibre.com>
Fri, 31 Aug 2012 15:42:44 +0000 (17:42 +0200)
The t/Barcodes_ValueBuilder.t test had the wrong number of tests
declared, and rather than checking that a variable was undefined I was
checking that it had a length of zero. Fixed both issues.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
t/Barcodes_ValueBuilder.t

index e134604..64d7fae 100644 (file)
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 use DBI;
-use Test::More tests => 15;
+use Test::More tests => 10;
 use Test::MockModule;
 
 BEGIN {
@@ -40,7 +40,7 @@ my ($nextnum, $scr, $history);
 
 ($nextnum, $scr) = C4::Barcodes::ValueBuilder::incremental::get_barcode(\%args);
 is($nextnum, 33333074344564, 'incremental barcode');
-ok(length($scr) == 0, 'incremental javascript');
+is($scr, undef, 'incremental javascript');
 
 # This should run exactly one query so we can test
 $history = $dbh->{mock_all_history};
@@ -70,7 +70,7 @@ $dbh->{mock_add_resultset} = $annualdata;
 $dbh->{mock_clear_history} = 1;
 ($nextnum, $scr) = C4::Barcodes::ValueBuilder::annual::get_barcode(\%args);
 is($nextnum, '2012-0035', 'annual barcode');
-ok(length($scr) == 0, 'annual javascript');
+is($scr, undef, 'annual javascript');
 
 # This should run exactly one query so we can test
 $history = $dbh->{mock_all_history};