1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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
```
This commit is contained in:
yuuji.yaginuma 2017-05-30 07:58:00 +09:00
parent e1758b5e8c
commit 966715d528

View file

@ -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"