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
This commit is contained in:
parent
62885f1ed1
commit
9d96fc17d7
@ -1,8 +1,9 @@
|
||||
require 'test/unit'
|
||||
|
||||
class TestTimeTZ < Test::Unit::TestCase
|
||||
force_tz_test = /linux/ =~ RUBY_PLATFORM || ENV["RUBY_FORCE_TIME_TZ_TEST"] == "yes"
|
||||
if force_tz_test
|
||||
def with_tz(tz)
|
||||
if /linux/ =~ RUBY_PLATFORM || ENV["RUBY_FORCE_TIME_TZ_TEST"] == "yes"
|
||||
old = ENV["TZ"]
|
||||
begin
|
||||
ENV["TZ"] = tz
|
||||
@ -10,7 +11,9 @@ class TestTimeTZ < Test::Unit::TestCase
|
||||
ensure
|
||||
ENV["TZ"] = old
|
||||
end
|
||||
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"
|
||||
def time_to_s(t)
|
||||
t.strftime("%Y-%m-%d %H:%M:%S ") + format_gmtoff(t.gmtoff)
|
||||
end
|
||||
else
|
||||
def time_to_s(t)
|
||||
t.to_s
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user