summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-06 09:50:08 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-06 09:50:08 +0000
commite4b05d91eb0d48fd172abf015c493bb42d755d07 (patch)
tree3cf92cbab2f330ea3ba25904dd74c427356a3967 /test
parentd85c226f73f5d59e03190ef8f29d316ea33f34e0 (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')
-rw-r--r--test/test_time.rb8
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") }