diff options
author | Nobuyoshi Nakada <[email protected]> | 2024-11-05 12:41:45 +0900 |
---|---|---|
committer | git <[email protected]> | 2024-11-05 04:19:39 +0000 |
commit | e4f5fd8e5fe6c8d69da4055636b8b048fe621bcf (patch) | |
tree | 896e0146a5675a605899d901be9db1c66af30702 | |
parent | ee4599dbe7e49a242a1e8170b0439cfb0130ad98 (diff) |
[ruby/date] Refine assertions
https://github.com/ruby/date/commit/1970b740d0
-rw-r--r-- | test/date/test_date_strftime.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/date/test_date_strftime.rb b/test/date/test_date_strftime.rb index 976e48f517..6ad69c0c27 100644 --- a/test/date/test_date_strftime.rb +++ b/test/date/test_date_strftime.rb @@ -416,9 +416,10 @@ class TestDateStrftime < Test::Unit::TestCase assert_equal(d2, DateTime.rfc3339('2001-02-03T04:05:06.123456+00:00', limit: 64)) assert_equal(d2, DateTime.jisx0301('H13.02.03T04:05:06.123456+00:00', limit: 64)) - assert_raise(ArgumentError) { DateTime.iso8601('2001-02-03T04:05:06.123456+00:00', limit: 1) } - assert_raise(ArgumentError) { DateTime.rfc3339('2001-02-03T04:05:06.123456+00:00', limit: 1) } - assert_raise(ArgumentError) { DateTime.jisx0301('H13.02.03T04:05:06.123456+00:00', limit: 1) } + exceeds = /string length \(\d+\) exceeds/ + assert_raise_with_message(ArgumentError, exceeds) {DateTime.iso8601('2001-02-03T04:05:06.123456+00:00', limit: 1)} + assert_raise_with_message(ArgumentError, exceeds) {DateTime.rfc3339('2001-02-03T04:05:06.123456+00:00', limit: 1)} + assert_raise_with_message(ArgumentError, exceeds) {DateTime.jisx0301('H13.02.03T04:05:06.123456+00:00', limit: 1)} %w(M06.01.01 M45.07.29 |