Skip to content

Commit

Permalink
Specify TimeZone before running tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tomykaira committed Dec 17, 2011
1 parent f37378f commit b512f7b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/delorean_spec.rb
Expand Up @@ -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
Expand Down

0 comments on commit b512f7b

Please sign in to comment.