From 966715d52811578f5fbbe63e2c5c441971f91b6f Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Tue, 30 May 2017 07:58:00 +0900 Subject: Reset time zone to previous value Since `CurrentAttributesTest` changed the global time zone, it is necessary to restore the original value after changing the test. The reproduction step: ``` ./bin/test -w --seed 5549 test/current_attributes_test.rb test/core_ext/date_ext_test.rb ``` --- activesupport/test/current_attributes_test.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'activesupport') diff --git a/activesupport/test/current_attributes_test.rb b/activesupport/test/current_attributes_test.rb index 67ef6ef619..a1f3b33444 100644 --- a/activesupport/test/current_attributes_test.rb +++ b/activesupport/test/current_attributes_test.rb @@ -28,7 +28,14 @@ class CurrentAttributesTest < ActiveSupport::TestCase end end - setup { Current.reset } + setup do + @original_time_zone = Time.zone + Current.reset + end + + teardown do + Time.zone = @original_time_zone + end test "read and write attribute" do Current.world = "world/1" -- cgit v1.2.3