aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-01-05 14:01:47 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-01-05 14:01:47 -0800
commit6d747108286790bb7f5fa9ffbfcbdf4a557a2785 (patch)
treea28827ca30120721f6fe00c1c62db69e79dc0b44 /activerecord/test
parent9731c862ecb827b16213c5bdb0f2bebbfaf9d608 (diff)
downloadrails-6d747108286790bb7f5fa9ffbfcbdf4a557a2785.tar.gz
rails-6d747108286790bb7f5fa9ffbfcbdf4a557a2785.tar.bz2
rails-6d747108286790bb7f5fa9ffbfcbdf4a557a2785.zip
make sure that Psych can roundtrip an AR object
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/yaml_serialization_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/activerecord/test/cases/yaml_serialization_test.rb b/activerecord/test/cases/yaml_serialization_test.rb
index 0fc9918744..7503b06126 100644
--- a/activerecord/test/cases/yaml_serialization_test.rb
+++ b/activerecord/test/cases/yaml_serialization_test.rb
@@ -17,4 +17,17 @@ class YamlSerializationTest < ActiveRecord::TestCase
t = YAML.load YAML.dump topic
assert_equal topic, t
end
+
+ begin
+ require 'psych'
+
+ def test_psych_roundtrip
+ topic = Topic.first
+ assert topic
+ t = Psych.load Psych.dump topic
+ assert_equal topic, t
+ end
+
+ rescue LoadError
+ end
end