Skip to content

Commit 07a48a6

Browse files
yahondaclaude
andcommitted
Restore ActiveRecord.default_timezone after #234 regression test
The new test set ActiveRecord.default_timezone = :utc but did not put the original value back, so it could affect tests that ran later in the same process. Capture the original value and restore it from the ensure block alongside the deprecator behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 732f713 commit 07a48a6

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

spec/plsql/schema_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ class TestModel < TestBaseModel
221221
it "should not emit ActiveRecord::Base.default_timezone deprecation warning (#234)" do
222222
skip "ActiveRecord.default_timezone is not available" unless ActiveRecord.respond_to?(:default_timezone=)
223223

224+
original_default_timezone = ActiveRecord.default_timezone
224225
ActiveRecord.default_timezone = :utc
225226

226227
deprecator = ActiveRecord.respond_to?(:deprecator) ? ActiveRecord.deprecator : ActiveSupport::Deprecation
@@ -231,6 +232,7 @@ class TestModel < TestBaseModel
231232
expect(plsql.default_timezone).to eq(:utc)
232233
ensure
233234
deprecator.behavior = original_behavior
235+
ActiveRecord.default_timezone = original_default_timezone
234236
end
235237

236238
expect(warnings.grep(/default_timezone/)).to be_empty

0 commit comments

Comments
 (0)