aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/helper.rb
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2013-10-25 15:59:04 +0200
committerYves Senn <yves.senn@gmail.com>2013-10-25 15:59:04 +0200
commita0599535aa8b15a13cfbbbaf888cdb0b8ee90307 (patch)
tree8e6d10729222bc9297a4a8cbff4320ba6175651a /activerecord/test/cases/helper.rb
parent2dc579baf4045fc6bcc38a2fe00d5fd19431201f (diff)
downloadrails-a0599535aa8b15a13cfbbbaf888cdb0b8ee90307.tar.gz
rails-a0599535aa8b15a13cfbbbaf888cdb0b8ee90307.tar.bz2
rails-a0599535aa8b15a13cfbbbaf888cdb0b8ee90307.zip
only warn on leaked time zone state instead of rasing an error.
Raising `RuntimeErrors` skips important cleanup code and leads to a lot of subsequent errors. This clutters the test output with a lot of noise.
Diffstat (limited to 'activerecord/test/cases/helper.rb')
-rw-r--r--activerecord/test/cases/helper.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/activerecord/test/cases/helper.rb b/activerecord/test/cases/helper.rb
index 7b38fcf529..2af647e2d7 100644
--- a/activerecord/test/cases/helper.rb
+++ b/activerecord/test/cases/helper.rb
@@ -78,21 +78,24 @@ EXPECTED_DEFAULT_TIMEZONE = :utc
EXPECTED_TIME_ZONE_AWARE_ATTRIBUTES = false
def verify_default_timezone_config
if Time.zone != EXPECTED_ZONE
- raise <<-MSG
+ $stderr.puts <<-MSG
+\n#{self.to_s}
Global state `Time.zone` was leaked.
Expected: #{EXPECTED_ZONE}
Got: #{Time.zone}
MSG
end
if ActiveRecord::Base.default_timezone != EXPECTED_DEFAULT_TIMEZONE
- raise <<-MSG
+ $stderr.puts <<-MSG
+\n#{self.to_s}
Global state `ActiveRecord::Base.default_timezone` was leaked.
Expected: #{EXPECTED_DEFAULT_TIMEZONE}
Got: #{ActiveRecord::Base.default_timezone}
MSG
end
if ActiveRecord::Base.time_zone_aware_attributes != EXPECTED_TIME_ZONE_AWARE_ATTRIBUTES
- raise <<-MSG
+ $stderr.puts <<-MSG
+\n#{self.to_s}
Global state `ActiveRecord::Base.time_zone_aware_attributes` was leaked.
Expected: #{EXPECTED_TIME_ZONE_AWARE_ATTRIBUTES}
Got: #{ActiveRecord::Base.time_zone_aware_attributes}