提交 692cfc50 编写于 作者: C Charlie Somerville

fix ActiveSupport::TimeWithZone#to_s test

上级 115baf13
...@@ -82,7 +82,8 @@ def test_to_formatted_s ...@@ -82,7 +82,8 @@ def test_to_formatted_s
end end
def test_to_s_db def test_to_s_db
assert_equal '2000-01-01 00:00:00', @twz.to_s(:db) # This test assumes the local timezone of the machine is Pacific.
assert_equal '1999-12-31 16:00:00', @twz.to_s(:db)
end end
def test_xmlschema def test_xmlschema
...@@ -696,7 +697,7 @@ def test_advance_1_year_during_dst ...@@ -696,7 +697,7 @@ def test_advance_1_year_during_dst
assert_equal "Sun, 15 Jul 2007 10:30:00 EDT -04:00", twz.years_ago(1).inspect assert_equal "Sun, 15 Jul 2007 10:30:00 EDT -04:00", twz.years_ago(1).inspect
assert_equal "Sun, 15 Jul 2007 10:30:00 EDT -04:00", (twz - 1.year).inspect assert_equal "Sun, 15 Jul 2007 10:30:00 EDT -04:00", (twz - 1.year).inspect
end end
protected protected
def with_env_tz(new_tz = 'US/Eastern') def with_env_tz(new_tz = 'US/Eastern')
old_tz, ENV['TZ'] = ENV['TZ'], new_tz old_tz, ENV['TZ'] = ENV['TZ'], new_tz
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册