[Rt-commit] r19192 - in rt/3.999/branches/config-in-db: . t/api

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon Apr 13 23:48:13 EDT 2009


Author: sunnavy
Date: Mon Apr 13 23:48:13 2009
New Revision: 19192

Modified:
   rt/3.999/branches/config-in-db/   (props changed)
   rt/3.999/branches/config-in-db/lib/RT/Test.pm
   rt/3.999/branches/config-in-db/t/api/date.t

Log:
 r20743 at sunnavys-mb (orig r19190):  sunnavy | 2009-04-14 10:34:15 +0800
 skip 2 tests if the timezone is not EDT
 r20744 at sunnavys-mb (orig r19191):  sunnavy | 2009-04-14 11:43:17 +0800
 set FullTextSearch to be enabled in test


Modified: rt/3.999/branches/config-in-db/lib/RT/Test.pm
==============================================================================

Modified: rt/3.999/branches/config-in-db/t/api/date.t
==============================================================================
--- rt/3.999/branches/config-in-db/t/api/date.t	(original)
+++ rt/3.999/branches/config-in-db/t/api/date.t	Mon Apr 13 23:48:13 2009
@@ -8,9 +8,12 @@
 
 use RT::Model::User;
 use Test::Warn;
+use POSIX;
+my $time_zone = strftime("%Z", localtime());
 
 use_ok('RT::DateTime');
 
+
 set_fixed_time("2005-11-28T15:10:00Z");
 
 {
@@ -224,14 +227,18 @@
     $date = RT::DateTime->new_from_string('2005-11-28 15:10:00', time_zone => 'UTC' );
     is($date->iso, '2005-11-28 18:10:00', "YYYY-DD-MM hh:mm:ss");
 
-    # relative dates
-    $date = RT::DateTime->new_from_string('now');
-    is($date->iso, '2005-11-28 10:10:00', "YYYY-DD-MM hh:mm:ss");
+  SKIP: {
+        skip 'current timezone is not EDT', 2 unless $time_zone eq 'EDT';
 
-    $date = RT::DateTime->new_from_string('1 day ago');
-    is($date->iso, '2005-11-27 13:10:00', "YYYY-DD-MM hh:mm:ss");
+        # relative dates
+        $date = RT::DateTime->new_from_string('now');
+        is( $date->iso, '2005-11-28 10:10:00', "YYYY-DD-MM hh:mm:ss" );
 
-    RT->config->set( time_zone => 'UTC' );
+        $date = RT::DateTime->new_from_string('1 day ago');
+        is( $date->iso, '2005-11-27 13:10:00', "YYYY-DD-MM hh:mm:ss" );
+    }
+
+    RT->config->set( TimeZone => 'UTC' );
     $date = RT::DateTime->new_from_string('2005-11-28 15:10:00');
     is($date->iso, '2005-11-28 15:10:00', "YYYY-DD-MM hh:mm:ss");
 


More information about the Rt-commit mailing list