summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-02 07:46:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-02 07:46:38 +0000
commit482bbde6e25620b340e28423c08e3cee941c438b (patch)
tree3b9b9f80eea65607206cf04e7d57e4af329a6ee9 /test
parentb53114dd99aeb4c0696c8cd7f013c2bf850747dc (diff)
time.c: [DOC] Time#localtime
* time.c: state that Time#localtime does nothing when nothing changes. [ruby-core:87675] [Bug #14880] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_time_tz.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_time_tz.rb b/test/ruby/test_time_tz.rb
index b32caff9c5..f14800a1ad 100644
--- a/test/ruby/test_time_tz.rb
+++ b/test/ruby/test_time_tz.rb
@@ -105,6 +105,17 @@ class TestTimeTZ < Test::Unit::TestCase
assert_equal(expected, real, m)
end
+ def test_localtime_zone
+ t = with_tz("America/Los_Angeles") {
+ Time.local(2000, 1, 1)
+ }
+ z1 = t.zone
+ z2 = with_tz(tz="Asia/Singapore") {
+ t.localtime.zone
+ }
+ assert_equal(z2, z1)
+ end
+
def test_america_los_angeles
with_tz(tz="America/Los_Angeles") {
assert_time_constructor(tz, "2007-03-11 03:00:00 -0700", :local, [2007,3,11,2,0,0])