diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-10-13 20:28:55 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-10-13 20:28:55 +0000 |
commit | f0448f5631288e3b73f9c95ebc1870dd54967a87 (patch) | |
tree | 16f700a80c148bd3d1cadd2279e81781cc326b6c /activesupport/test/core_ext | |
parent | 43b6a74fb188e41ae686c2d948e876c1f84e7bdf (diff) | |
download | rails-f0448f5631288e3b73f9c95ebc1870dd54967a87.tar.gz rails-f0448f5631288e3b73f9c95ebc1870dd54967a87.tar.bz2 rails-f0448f5631288e3b73f9c95ebc1870dd54967a87.zip |
Fixed that Time#change should also reset usec when also resetting minutes #2459 [ikeda@dream.big.or.jp]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2568 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r-- | activesupport/test/core_ext/time_ext_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/time_ext_test.rb b/activesupport/test/core_ext/time_ext_test.rb index 86f8b7e4f6..0119c92c93 100644 --- a/activesupport/test/core_ext/time_ext_test.rb +++ b/activesupport/test/core_ext/time_ext_test.rb @@ -100,6 +100,11 @@ class TimeExtCalculationsTest < Test::Unit::TestCase assert_equal Time.local(2005,2,22,16), Time.local(2005,2,22,15,15,10).change(:hour => 16) assert_equal Time.local(2005,2,22,16,45), Time.local(2005,2,22,15,15,10).change(:hour => 16, :min => 45) assert_equal Time.local(2005,2,22,15,45), Time.local(2005,2,22,15,15,10).change(:min => 45) + + assert_equal Time.local(2005,1,2, 5, 0, 0, 0), Time.local(2005,1,2,11,22,33,44).change(:hour => 5) + assert_equal Time.local(2005,1,2,11, 6, 0, 0), Time.local(2005,1,2,11,22,33,44).change(:min => 6) + assert_equal Time.local(2005,1,2,11,22, 7, 0), Time.local(2005,1,2,11,22,33,44).change(:sec => 7) + assert_equal Time.local(2005,1,2,11,22,33, 8), Time.local(2005,1,2,11,22,33,44).change(:usec => 8) end def test_utc_change |