diff options
-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 |