From 20dbebbba2842ffe9b0f523691a1eb85d8bdc19f Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 26 Nov 2012 10:39:51 -0300 Subject: [PATCH] Bug 9142 - Remove the use of subtests Debian stable's version of Test::More is older than the one I used on my 12.04 dev box, and doesn't support subtests, which I used to avoid side effects between different test scenarios. This patch removes that subtest definition. --- t/Calendar.t | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/t/Calendar.t b/t/Calendar.t index d6972d0..07abbd4 100755 --- a/t/Calendar.t +++ b/t/Calendar.t @@ -4,7 +4,7 @@ use strict; use warnings; use DateTime; use DateTime::Duration; -use Test::More tests => 22; +use Test::More tests => 26; use Koha::DateUtils; BEGIN { @@ -127,9 +127,9 @@ my $one_day_dur = DateTime::Duration->new( days => 1 ); my $two_day_dur = DateTime::Duration->new( days => 2 ); my $seven_day_dur = DateTime::Duration->new( days => 7 ); -subtest '\'Datedue\' tests' => sub { - my $cal = Koha::Calendar->new( TEST_MODE => 1 , - days_mode => 'Datedue'); + ## 'Datedue' tests + $cal = Koha::Calendar->new( TEST_MODE => 1 , + days_mode => 'Datedue'); $cal->add_holiday( dt_from_string('2012-07-04','iso') ); $dt = dt_from_string( '2012-07-03','iso' ); @@ -145,12 +145,12 @@ subtest '\'Datedue\' tests' => sub { cmp_ok($cal->addDate( $test_dt, $seven_day_dur, 'days' ), 'eq', '2012-07-30T11:53:00', 'Add 7 days (Datedue)' ); -}; -subtest '\'Calendar\' tests' => sub { - my $cal = Koha::Calendar->new( TEST_MODE => 1, - days_mode => 'Calendar' ); + + ## 'Calendar' tests' + $cal = Koha::Calendar->new( TEST_MODE => 1, + days_mode => 'Calendar' ); $cal->add_holiday( dt_from_string('2012-07-04','iso') ); $dt = dt_from_string('2012-07-03','iso'); @@ -162,12 +162,12 @@ subtest '\'Calendar\' tests' => sub { cmp_ok($cal->addDate( $test_dt, $seven_day_dur, 'days' ), 'eq', '2012-07-31T11:53:00', 'Add 7 days (Calendar)' ); -}; -subtest '\'Days\' tests' => sub { - my $cal = Koha::Calendar->new( TEST_MODE => 1, - days_mode => 'Days' ); + + ## 'Days' tests + $cal = Koha::Calendar->new( TEST_MODE => 1, + days_mode => 'Days' ); $cal->add_holiday( dt_from_string('2012-07-04','iso') ); $dt = dt_from_string('2012-07-03','iso'); @@ -179,4 +179,4 @@ subtest '\'Days\' tests' => sub { cmp_ok($cal->addDate( $test_dt, $seven_day_dur, 'days' ),'eq', '2012-07-30T11:53:00', 'Add 7 days (Days)' ); -}; + -- 1.7.10.4