diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-12-23 23:22:24 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-12-23 23:22:24 +0000 |
commit | e2b6919223cd24bc8e64b4b5230733c0d8f8e6fc (patch) | |
tree | dd249fdc56c3e2c45e6f9587f668ec4dbcfd9c63 /activerecord | |
parent | 4d8ee28841261827c22322e769cb00c4f4fdc3e6 (diff) | |
download | rails-e2b6919223cd24bc8e64b4b5230733c0d8f8e6fc.tar.gz rails-e2b6919223cd24bc8e64b4b5230733c0d8f8e6fc.tar.bz2 rails-e2b6919223cd24bc8e64b4b5230733c0d8f8e6fc.zip |
stop test resetting global state
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/yaml_serialization_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/yaml_serialization_test.rb b/activerecord/test/cases/yaml_serialization_test.rb index 5a38f2c6ee..2b4ec81199 100644 --- a/activerecord/test/cases/yaml_serialization_test.rb +++ b/activerecord/test/cases/yaml_serialization_test.rb @@ -5,10 +5,16 @@ class YamlSerializationTest < ActiveRecord::TestCase fixtures :topics def test_to_yaml_with_time_with_zone_should_not_raise_exception + tz = Time.zone Time.zone = ActiveSupport::TimeZone["Pacific Time (US & Canada)"] ActiveRecord::Base.time_zone_aware_attributes = true + topic = Topic.new(:written_on => DateTime.now) assert_nothing_raised { topic.to_yaml } + + ensure + Time.zone = tz + ActiveRecord::Base.time_zone_aware_attributes = false end def test_roundtrip |