1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

more tests

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2010-06-10 15:27:07 +00:00
parent 5f8eeea366
commit 42eca4f46e

View file

@ -177,12 +177,16 @@ class TestTimeTZ < Test::Unit::TestCase
gmtoff]
}
sample.each {|tz, u, l, gmtoff|
expected_utc = "%04d-%02d-%02d %02d:%02d:%02d UTC" % u
expected = "%04d-%02d-%02d %02d:%02d:%02d %s" % (l+[format_gmtoff(gmtoff)])
mesg = "TZ=#{tz} Time.utc(#{u.map {|arg| arg.inspect }.join(', ')}).localtime"
mesg_utc = "TZ=#{tz} Time.utc(#{u.map {|arg| arg.inspect }.join(', ')})"
mesg = "#{mesg_utc}.localtime"
define_method(gen_test_name(tz)) {
with_tz(tz) {
t = nil
assert_nothing_raised(mesg) { t = Time.utc(*u).localtime }
assert_nothing_raised(mesg) { t = Time.utc(*u) }
assert_equal(expected_utc, time_to_s(t), mesg_utc)
assert_nothing_raised(mesg) { t.localtime }
assert_equal(expected, time_to_s(t), mesg)
assert_equal(gmtoff, t.gmtoff)
}