@@ -483,6 +483,14 @@ def test_advance
483
483
assert_equal Time . local ( 2005 , 2 , 28 , 20 , 22 , 19 ) , Time . local ( 2005 , 2 , 28 , 15 , 15 , 10 ) . advance ( hours : 5 , minutes : 7 , seconds : 9 )
484
484
assert_equal Time . local ( 2005 , 2 , 28 , 10 , 8 , 1 ) , Time . local ( 2005 , 2 , 28 , 15 , 15 , 10 ) . advance ( hours : -5 , minutes : -7 , seconds : -9 )
485
485
assert_equal Time . local ( 2013 , 10 , 17 , 20 , 22 , 19 ) , Time . local ( 2005 , 2 , 28 , 15 , 15 , 10 ) . advance ( years : 7 , months : 19 , weeks : 2 , days : 5 , hours : 5 , minutes : 7 , seconds : 9 )
486
+
487
+ assert_equal Time . new ( 2021 , 5 , 29 , 0 , 0 , 0 , "+03:00" ) , Time . new ( 2021 , 5 , 29 , 0 , 0 , 0 , ActiveSupport ::TimeZone [ "Moscow" ] )
488
+ assert_equal Time . new ( 2021 , 5 , 29 , 0 , 0 , 0 , "+03:00" ) . advance ( seconds : 60 ) , Time . new ( 2021 , 5 , 29 , 0 , 0 , 0 , ActiveSupport ::TimeZone [ "Moscow" ] ) . advance ( seconds : 60 )
489
+ assert_equal Time . new ( 2021 , 5 , 29 , 0 , 0 , 0 , "+03:00" ) . advance ( days : 3 ) , Time . new ( 2021 , 5 , 29 , 0 , 0 , 0 , ActiveSupport ::TimeZone [ "Moscow" ] ) . advance ( days : 3 )
490
+
491
+ assert_equal Time . new ( 2021 , 5 , 29 , 0 , 0 , 0 , "+03:00" ) , ActiveSupport ::TimeZone [ "Moscow" ] . local ( 2021 , 5 , 29 , 0 , 0 , 0 )
492
+ assert_equal Time . new ( 2021 , 5 , 29 , 0 , 0 , 0 , "+03:00" ) . advance ( seconds : 60 ) , ActiveSupport ::TimeZone [ "Moscow" ] . local ( 2021 , 5 , 29 , 0 , 0 , 0 ) . advance ( seconds : 60 )
493
+ assert_equal Time . new ( 2021 , 5 , 29 , 0 , 0 , 0 , "+03:00" ) . advance ( days : 3 ) , ActiveSupport ::TimeZone [ "Moscow" ] . local ( 2021 , 5 , 29 , 0 , 0 , 0 ) . advance ( days : 3 )
486
494
end
487
495
488
496
def test_utc_advance
0 commit comments