diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-05 14:03:34 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-05 14:03:34 +0000 |
commit | 5fa7cdbde54bed9bda3f9de20d621989a19ddc3b (patch) | |
tree | fdb4f26212caebd3f88b3869e2e5b4ca9106e51f /test/test_time.rb | |
parent | 2d8841791facb07155c710d8a7db7b0bf8be0d21 (diff) |
Time.parse's "now" argument as nil works again.
* lib/time.rb (make_time): "now" argument as nil works again.
This is broken since Ruby 2.2.
Mathieu Jobin pointed a problem.
https://github.com/ruby/ruby/commit/e4b05d91eb0d48fd172abf015c493bb42d755d07#commitcomment-17421387
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_time.rb')
-rw-r--r-- | test/test_time.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/test_time.rb b/test/test_time.rb index 0a6659f152..398ab7279b 100644 --- a/test/test_time.rb +++ b/test/test_time.rb @@ -338,6 +338,11 @@ class TestTimeExtension < Test::Unit::TestCase # :nodoc: assert_equal(t1.utc?, t2.utc?) end + def test_parse_now_nil + assert_equal(Time.new(2000,1,1,0,0,0,"+11:00"), + Time.parse("2000-01-01T00:00:00+11:00", nil)) + end + def test_parse_leap_second t = Time.utc(1998,12,31,23,59,59) assert_equal(t, Time.parse("Thu Dec 31 23:59:59 UTC 1998")) |