diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-06 09:50:08 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-06 09:50:08 +0000 |
commit | e4b05d91eb0d48fd172abf015c493bb42d755d07 (patch) | |
tree | 3cf92cbab2f330ea3ba25904dd74c427356a3967 /test/test_time.rb | |
parent | d85c226f73f5d59e03190ef8f29d316ea33f34e0 (diff) |
* lib/time.rb (Time.make_time): Adjust the time zone of "now".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_time.rb')
-rw-r--r-- | test/test_time.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_time.rb b/test/test_time.rb index e91ce7e73c..c516d29227 100644 --- a/test/test_time.rb +++ b/test/test_time.rb @@ -238,6 +238,14 @@ class TestTimeExtension < Test::Unit::TestCase # :nodoc: assert_raise(ArgumentError) { Time.parse("foo", now) } end + def test_completion_with_different_timezone + now = Time.new(2001,2,3,0,0,0,"+09:00") # 2001-02-02 15:00:00 UTC + t = Time.parse("10:20:30 GMT", now) + assert_equal(Time.utc(2001,2,2,10,20,30), t) + assert_equal(false, t.utc?) + assert_equal(0, t.utc_offset) + end + def test_invalid # They were actually used in some web sites. assert_raise(ArgumentError) { Time.httpdate("1 Dec 2001 10:23:57 GMT") } |