diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-04 09:35:20 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-04 09:35:20 -0800 |
commit | cf32a59ed6134d417503448c951b137aeceba81d (patch) | |
tree | b2d0b21f0796ca39d598579a5bc5996204e8cf08 /activerecord/test/cases | |
parent | e094b8d251550128a2986b9efed7ab725b439546 (diff) | |
parent | 7d26fad384a99aea27e478474f5b8d24ae33b704 (diff) | |
download | rails-cf32a59ed6134d417503448c951b137aeceba81d.tar.gz rails-cf32a59ed6134d417503448c951b137aeceba81d.tar.bz2 rails-cf32a59ed6134d417503448c951b137aeceba81d.zip |
Merge pull request #4298 from rafaelfranca/patch-2
Remove rescue block to require psych gem
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/yaml_serialization_test.rb | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/activerecord/test/cases/yaml_serialization_test.rb b/activerecord/test/cases/yaml_serialization_test.rb index 2b4ec81199..302913e095 100644 --- a/activerecord/test/cases/yaml_serialization_test.rb +++ b/activerecord/test/cases/yaml_serialization_test.rb @@ -1,4 +1,4 @@ -require "cases/helper" +require 'cases/helper' require 'models/topic' class YamlSerializationTest < ActiveRecord::TestCase @@ -36,22 +36,17 @@ class YamlSerializationTest < ActiveRecord::TestCase assert_equal({'attributes' => topic.attributes}, coder) end - begin - require 'psych' - - def test_psych_roundtrip - topic = Topic.first - assert topic - t = Psych.load Psych.dump topic - assert_equal topic, t - end - - def test_psych_roundtrip_new_object - topic = Topic.new - assert topic - t = Psych.load Psych.dump topic - assert_equal topic.attributes, t.attributes - end - rescue LoadError + def test_psych_roundtrip + topic = Topic.first + assert topic + t = Psych.load Psych.dump topic + assert_equal topic, t + end + + def test_psych_roundtrip_new_object + topic = Topic.new + assert topic + t = Psych.load Psych.dump topic + assert_equal topic.attributes, t.attributes end end |