Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #11477 (closed defect: fixed)

Opened 8 months ago

Last modified 8 months ago

[PATCH] Ensure migration test passes when run on a machine with a timezone set to GMT

Reported by: thechrisoshow Assigned to: core
Priority: normal Milestone: 2.x
Component: ActiveRecord Version: edge
Severity: normal Keywords:
Cc:

Description

The test test_native_types (in the file migration_test.rb) fails when run on a box that has a timezone set to GMT (London time).

This is because it tests to see if the returned timezone offset is not 0 - but unfortunately if you're in GMT the offset will always be 0.

To see this work, change the local settings on your machine to GMT and run the ActiveRecord tests. You'll see this test fail.

Attachments

fix_migration_test_for_gmt.diff (1.4 kB) - added by thechrisoshow on 03/31/08 09:35:23.
Fixes a migration test so that it passes when run on a box set to GMT timezone
fix_migration_test_for_gmt.2.diff (1.6 kB) - added by thechrisoshow on 03/31/08 22:28:22.
fix_migration_test_for_gmt.3.diff (1.6 kB) - added by thechrisoshow on 03/31/08 22:34:54.

Change History

03/31/08 09:35:23 changed by thechrisoshow

  • attachment fix_migration_test_for_gmt.diff added.

Fixes a migration test so that it passes when run on a box set to GMT timezone

03/31/08 22:28:22 changed by thechrisoshow

  • attachment fix_migration_test_for_gmt.2.diff added.

03/31/08 22:34:54 changed by thechrisoshow

  • attachment fix_migration_test_for_gmt.3.diff added.

03/31/08 22:37:50 changed by snowblink

+1 using fix_migration_test_for_gmt.3.diff the migration_test.rb passes.

04/01/08 00:28:43 changed by bitsweat

  • status changed from new to closed.
  • resolution set to fixed.

(In [9175]) Fix migration test when run in GMT zone. Closes #11477 [thechrisoshow]