From b512f7b7149502cebceb5ddbb8bcd3a152ad09ee Mon Sep 17 00:00:00 2001 From: tomykaira Date: Sat, 17 Dec 2011 14:15:14 +0900 Subject: [PATCH] Specify TimeZone before running tests In Japan, the test failed with the following message. 'Delorean time_travel_to with block should travel through time several times' FAILED expected: Thu, 01 Jan 2009, got: Fri, 02 Jan 2009 (using ==) The test should set running envrionment(UTC) by itself, or convert all date and time to UTC. --- spec/delorean_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/delorean_spec.rb b/spec/delorean_spec.rb index 51722db..09e3b61 100644 --- a/spec/delorean_spec.rb +++ b/spec/delorean_spec.rb @@ -4,6 +4,15 @@ describe Delorean do + before(:all) do + @default_tz = ENV['TZ'] + ENV['TZ'] = 'UTC' + end + + after(:all) do + ENV['TZ'] = @default_tz + end + after(:each) do Delorean.back_to_the_present end