From 42eca4f46e2cf48a0a1a66bc5d6599c8414bb67e Mon Sep 17 00:00:00 2001 From: akr Date: Thu, 10 Jun 2010 15:27:07 +0000 Subject: [PATCH] more tests git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_time_tz.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/ruby/test_time_tz.rb b/test/ruby/test_time_tz.rb index 857b41a4cf..1041e31d2b 100644 --- a/test/ruby/test_time_tz.rb +++ b/test/ruby/test_time_tz.rb @@ -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) }