[Bug 642985] Review Request: rubygem-timecop - Provides a unified method to mock Time.now, Date.today in a single call

bugzilla at redhat.com bugzilla at redhat.com
Thu Oct 21 10:52:13 UTC 2010


Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug.


https://bugzilla.redhat.com/show_bug.cgi?id=642985

--- Comment #2 from Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> 2010-10-21 06:52:13 EDT ---
Well,

When I try on my F-14 machine:
[tasaka1 at localhost ~]$ uname -a
Linux localhost.localdomain 2.6.35.6-43.fc14.i686 #1 SMP Wed Oct 13 21:36:03
UTC 2010 i686 i686 i386 GNU/Linux
[tasaka1 at localhost ~]$ rpm -q ruby
ruby-1.8.7.302-1.fc14.i686

I see one more failure (I am not using Xen or so)
$ ruby -I../lib ./test_time_stack_item.rb 
Loaded suite ./test_time_stack_item
Started
FFF.F...........
Finished in 0.113762 seconds.

  1) Failure:
test_compute_dst_adjustment_for_dst_to_dst(TestTimeStackItem)
[./test_time_stack_item.rb:100]:
precondition.
<false> is not true.

  2) Failure:
test_compute_dst_adjustment_for_dst_to_non_dst(TestTimeStackItem)
[./test_time_stack_item.rb:118]:
precondition.
<false> is not true.

  3) Failure:
test_compute_dst_adjustment_for_non_dst_to_dst(TestTimeStackItem)
[./test_time_stack_item.rb:128]:
precondition.
<false> is not true.

  4) Failure:
test_datetime_for_dst_to_non_dst(TestTimeStackItem)
[./test_time_stack_item.rb:139]:
<#<Date: 4910229/2,0,2299161>> expected but was
<#<Date: 4910231/2,0,2299161>>.

I guess the first 3 test failures are because Japan does not use
DST at all (currently uses JST = UTC + 9 hour all year) so 
for example
$ ruby -e "require 'time' ; puts Time.now.dst?"
always shows "false" (on Japan). Note that the line 100
in test_time_stack_item.rb says:
---------------------------------------------------------
   100      assert Time.now.dst?, "precondition"
---------------------------------------------------------

4th test failure occurs on the line 139 in test_time_stack_item.rb:
   132    # Ensure DateTime's handle changing DST properly
   133    def test_datetime_for_dst_to_non_dst
   134      Timecop.freeze(DateTime.parse("2009-12-1 00:38:00 -0500"))
   135      t = DateTime.parse("2009-10-11 00:00:00 -0400")
   136      tsi = Timecop::TimeStackItem.new(:freeze, t)
   137      assert_date_times_equal t, tsi.datetime
   138      # verify Date also 'moves backward' an hour to change the day
   139      assert_equal Date.new(2009, 10, 10), tsi.date
   140    end
I have not investigated here yet, however I think the failure on
this also related to timezone issue.

So I am not sure if the test failures are really related to
bug 640608. It seems that you have to set TZ or DST setting or so to make
these tests pass (I guess simply disabling these tests is simpler).

-- 
Configure bugmail: https://bugzilla.redhat.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the package-review mailing list