aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-19 08:53:40 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-19 08:53:40 +0000
commit4dd1cf3b27f5a92045176129ff2d4f5d8cea466a (patch)
tree83a85cfc37ed695982c26d99d1b78c25ebfc855b /test/ruby
parentfb042e0f0c6c7380ca1c68b3a8cb4b523ce164eb (diff)
downloadruby-4dd1cf3b27f5a92045176129ff2d4f5d8cea466a.tar.gz
time.c: added in: option to Time.now
* time.c (time_s_now): added in: option to Time.now as well as Time.at. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_time_tz.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_time_tz.rb b/test/ruby/test_time_tz.rb
index f0803d2742..c43c5878c0 100644
--- a/test/ruby/test_time_tz.rb
+++ b/test/ruby/test_time_tz.rb
@@ -582,6 +582,11 @@ module TestTimeTZ::WithTZ
assert_equal(time_class.utc(2018, 9, 1, 12+h, m, 0).to_i, t.to_i)
end
+ def subtest_now(time_class, tz, tzarg, tzname, abbr, utc_offset)
+ t = time_class.now(in: tzarg)
+ assert_equal(tz, t.zone)
+ end
+
def subtest_getlocal(time_class, tz, tzarg, tzname, abbr, utc_offset)
t = time_class.utc(2018, 9, 1, 12, 0, 0).getlocal(tzarg)
h, m = (utc_offset / 60).divmod(60)