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:
parent
e1758b5e8c
commit
966715d528
1 changed files with 8 additions and 1 deletions
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue