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

Changeset 9009

Show
Ignore:
Timestamp:
03/11/08 07:19:36 (6 months ago)
Author:
gbuesing
Message:

Fix Numeric time tests broken by DST change by anchoring them to fixed times instead of Time.now. Anchor TimeZone#now DST test to time specified with Time.at instead of Time.local to work around platform differences with Time.local and DST representation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activesupport/CHANGELOG

    r9008 r9009  
    11*SVN* 
     2 
     3* Fix Numeric time tests broken by DST change by anchoring them to fixed times instead of Time.now. Anchor TimeZone#now DST test to time specified with Time.at instead of Time.local to work around platform differences with Time.local and DST representation [Geoff Buesing] 
    24 
    35* Removing unneeded #change_time_zone method from Time, DateTime and TimeWithZone [Geoff Buesing] 
  • trunk/activesupport/test/core_ext/numeric_ext_test.rb

    r8635 r9009  
    33class NumericExtTimeAndDateTimeTest < Test::Unit::TestCase 
    44  def setup 
    5     @now = Time.now 
    6     @dtnow = DateTime.now 
     5    @now = Time.local(2005,2,10,15,30,45) 
     6    @dtnow = DateTime.civil(2005,2,10,15,30,45) 
    77    @seconds = { 
    88      1.minute   => 60, 
  • trunk/activesupport/test/time_zone_test.rb

    r9007 r9009  
    8484      def test_now_enforces_fall_dst_rules 
    8585        with_env_tz 'US/Eastern' do 
    86           Time.stubs(:now).returns(Time.local(2006,10,29,1)) # 1AM is ambiguous; could be DST or non-DST 1AM 
     86          Time.stubs(:now).returns(Time.at(1162098000)) # equivalent to 1AM DST 
    8787          zone = TimeZone['Eastern Time (US & Canada)'] 
    88           assert_equal Time.utc(2006,10,29,1), zone.now.time # selects DST 1AM 
     88          assert_equal Time.utc(2006,10,29,1), zone.now.time 
    8989          assert_equal true, zone.now.dst? 
    9090        end