aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext
diff options
context:
space:
mode:
authorAgis- <corestudiosinc@gmail.com>2014-09-01 15:54:29 +0300
committerAgis- <corestudiosinc@gmail.com>2014-09-04 22:21:38 +0300
commit57b2c371f03982813f6dc2e7f07467b4fca3a6ce (patch)
tree47e244ea91e21fedd889d7a934d381200635e3f6 /activesupport/test/core_ext
parent703a2e8da1d3a68b3902d9024c6f0d1cd32435aa (diff)
downloadrails-57b2c371f03982813f6dc2e7f07467b4fca3a6ce.tar.gz
rails-57b2c371f03982813f6dc2e7f07467b4fca3a6ce.tar.bz2
rails-57b2c371f03982813f6dc2e7f07467b4fca3a6ce.zip
Time#change throws exception with an out-of-range :usec
https://github.com/rails/rails/commit/98b46bf5e201307cae56ee14bf41363a539779c5 did not properly handled out-of-range `:usec`s. Passing a `:usec` that's out of range now throws an `ArgumentError` as it should. Fixes #16759.
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r--activesupport/test/core_ext/time_ext_test.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/time_ext_test.rb b/activesupport/test/core_ext/time_ext_test.rb
index c8283cddc5..9a5bd19be2 100644
--- a/activesupport/test/core_ext/time_ext_test.rb
+++ b/activesupport/test/core_ext/time_ext_test.rb
@@ -405,6 +405,7 @@ class TimeExtCalculationsTest < ActiveSupport::TestCase
assert_equal Time.new(2005,2,22,16,0,0,"-08:00"), Time.new(2005,2,22,15,15,10,"-08:00").change(:hour => 16)
assert_equal Time.new(2005,2,22,16,45,0,"-08:00"), Time.new(2005,2,22,15,15,10,"-08:00").change(:hour => 16, :min => 45)
assert_equal Time.new(2005,2,22,15,45,0,"-08:00"), Time.new(2005,2,22,15,15,10,"-08:00").change(:min => 45)
+ assert_raise(ArgumentError) { Time.new(2005, 2, 22, 15, 15, 45, "-08:00").change(:usec => 1000000) }
end
def test_advance