aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_time.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-28 15:19:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-28 15:19:38 +0000
commit71fed537ac6c989bded172eee185c1fc4ed84ad4 (patch)
treec281264d59820f7d61a26e05f02cb0032446347e /test/test_time.rb
parent3e2ff59f10e606bfc07ab9cb1fd488f024474e8d (diff)
downloadruby-71fed537ac6c989bded172eee185c1fc4ed84ad4.tar.gz
time.rb: fix parsing time zone in iso8601
* lib/time.rb (Time.xmlschema): a colon in time zone designator can be omitted. [ruby-core:87277] [Bug #14790] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_time.rb')
-rw-r--r--test/test_time.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/test_time.rb b/test/test_time.rb
index 9d7c976abf..d01d74eb52 100644
--- a/test/test_time.rb
+++ b/test/test_time.rb
@@ -105,6 +105,7 @@ class TestTimeExtension < Test::Unit::TestCase # :nodoc:
t = Time.utc(1996, 12, 20, 0, 39, 57)
s = "1996-12-19T16:39:57-08:00"
assert_equal(t, Time.__send__(method, s))
+ assert_equal(t, Time.__send__(method, s.sub(/:(?=00\z)/, '')))
# There is no way to generate time string with arbitrary timezone.
s = "1996-12-20T00:39:57Z"
assert_equal(t, Time.__send__(method, s))