[Rt-commit] r19190 - rt/3.999/trunk/t/api
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Mon Apr 13 22:34:15 EDT 2009
Author: sunnavy
Date: Mon Apr 13 22:34:15 2009
New Revision: 19190
Modified:
rt/3.999/trunk/t/api/date.t
Log:
skip 2 tests if the timezone is not EDT
Modified: rt/3.999/trunk/t/api/date.t
==============================================================================
--- rt/3.999/trunk/t/api/date.t (original)
+++ rt/3.999/trunk/t/api/date.t Mon Apr 13 22:34:15 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,12 +227,16 @@
$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';
+
+ # relative dates
+ $date = RT::DateTime->new_from_string('now');
+ is( $date->iso, '2005-11-28 10:10:00', "YYYY-DD-MM hh:mm:ss" );
- $date = RT::DateTime->new_from_string('1 day ago');
- is($date->iso, '2005-11-27 13:10:00', "YYYY-DD-MM hh:mm:ss");
+ $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');
More information about the Rt-commit
mailing list