diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-04-18 01:58:49 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-04-18 01:58:49 +0000 |
commit | 9d96fc17d7ed40ae7e0be723e1ae008cd4d0424a (patch) | |
tree | 1e709c8d3ef2997bd81b0a9c75673f106b64a71b | |
parent | 62885f1ed1b7e4808c062194025c03b55f5d8a7e (diff) | |
download | ruby-9d96fc17d7ed40ae7e0be723e1ae008cd4d0424a.tar.gz |
split method definitions
* test/ruby/test_time_tz.rb (TestTimeTZ#with_tz, TestTimeTZ#time_to_s):
split method definitions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/ruby/test_time_tz.rb | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/test/ruby/test_time_tz.rb b/test/ruby/test_time_tz.rb index 42c4607bf3..a8229a618a 100644 --- a/test/ruby/test_time_tz.rb +++ b/test/ruby/test_time_tz.rb @@ -1,8 +1,9 @@ require 'test/unit' class TestTimeTZ < Test::Unit::TestCase - def with_tz(tz) - if /linux/ =~ RUBY_PLATFORM || ENV["RUBY_FORCE_TIME_TZ_TEST"] == "yes" + force_tz_test = /linux/ =~ RUBY_PLATFORM || ENV["RUBY_FORCE_TIME_TZ_TEST"] == "yes" + if force_tz_test + def with_tz(tz) old = ENV["TZ"] begin ENV["TZ"] = tz @@ -10,7 +11,9 @@ class TestTimeTZ < Test::Unit::TestCase ensure ENV["TZ"] = old end - else + end + else + def with_tz(tz) if ENV["TZ"] == tz yield end @@ -60,10 +63,12 @@ class TestTimeTZ < Test::Unit::TestCase include Util extend Util - def time_to_s(t) - if RUBY_VERSION < "1.9" + if RUBY_VERSION < "1.9" + def time_to_s(t) t.strftime("%Y-%m-%d %H:%M:%S ") + format_gmtoff(t.gmtoff) - else + end + else + def time_to_s(t) t.to_s end end |