diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-05 14:59:19 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-05 14:59:19 -0800 |
commit | eba8411652cb39529839083cf903f6ce76a69f4a (patch) | |
tree | 3f70a9f3c1045824f5188049c0cd51cc251d6d53 /activerecord/test | |
parent | 97bc74c74611d3d71d58776ed907ebd0cdb98a15 (diff) | |
download | rails-eba8411652cb39529839083cf903f6ce76a69f4a.tar.gz rails-eba8411652cb39529839083cf903f6ce76a69f4a.tar.bz2 rails-eba8411652cb39529839083cf903f6ce76a69f4a.zip |
adding an `encode_with` method for Psych dump/load methods
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/yaml_serialization_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/yaml_serialization_test.rb b/activerecord/test/cases/yaml_serialization_test.rb index abcf61ffc0..0b54c309d1 100644 --- a/activerecord/test/cases/yaml_serialization_test.rb +++ b/activerecord/test/cases/yaml_serialization_test.rb @@ -18,6 +18,13 @@ class YamlSerializationTest < ActiveRecord::TestCase assert_equal topic, t end + def test_encode_with_coder + topic = Topic.first + coder = {} + topic.encode_with coder + assert_equal({'attributes' => topic.attributes}, coder) + end + begin require 'psych' |