summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-12-25 16:19:33 +0900
committerNARUSE, Yui <naruse@airemix.jp>2021-12-25 18:39:24 +0900
commitcd50457455a7a1af5e0bcf896ce019b891038708 (patch)
treeb0969d0f453d332386b2272a3d05058ba58c4e83 /test
parente6e24ee502714b80723d81b3bc555a707747fda3 (diff)
Raise proper exception when month argument is not a name
https://bugs.ruby-lang.org/issues/17485#change-89871 (cherry picked from commit 0867b638aff9ec192ca420a44ffa5a77c892e8f2)
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_time.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb
index b3dc5d99e3..2fdf0c2010 100644
--- a/test/ruby/test_time.rb
+++ b/test/ruby/test_time.rb
@@ -49,7 +49,10 @@ class TestTime < Test::Unit::TestCase
t = Time.new(*tm, "-12:00")
assert_equal([2001,2,28,23,59,30,-43200], [t.year, t.month, t.mday, t.hour, t.min, t.sec, t.gmt_offset], bug4090)
assert_raise(ArgumentError) { Time.new(2000,1,1, 0,0,0, "+01:60") }
- assert_raise(ArgumentError) { Time.new(2021, 1, 1, "+09:99") }
+ msg = /invalid value for Integer/
+ assert_raise_with_message(ArgumentError, msg) { Time.new(2021, 1, 1, "+09:99") }
+ assert_raise_with_message(ArgumentError, msg) { Time.new(2021, 1, "+09:99") }
+ assert_raise_with_message(ArgumentError, msg) { Time.new(2021, "+09:99") }
end
def test_time_add()