aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/yaml_serialization_test.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafael.franca@plataformatec.com.br>2012-01-04 13:30:57 -0300
committerRafael Mendonça França <rafael.franca@plataformatec.com.br>2012-01-04 13:30:57 -0300
commit761b049b2e51a035eaf9c18f4d0200409848a28e (patch)
treebdfed99b3d0b46ca7e2b079a46d46fa241549eab /activerecord/test/cases/yaml_serialization_test.rb
parent0bf51e9805260243ec0bbe5fca8f8b9364fdd970 (diff)
downloadrails-761b049b2e51a035eaf9c18f4d0200409848a28e.tar.gz
rails-761b049b2e51a035eaf9c18f4d0200409848a28e.tar.bz2
rails-761b049b2e51a035eaf9c18f4d0200409848a28e.zip
No need to use rescue block to require psych
Diffstat (limited to 'activerecord/test/cases/yaml_serialization_test.rb')
-rw-r--r--activerecord/test/cases/yaml_serialization_test.rb32
1 files changed, 14 insertions, 18 deletions
diff --git a/activerecord/test/cases/yaml_serialization_test.rb b/activerecord/test/cases/yaml_serialization_test.rb
index 2b4ec81199..dfdb27e5ab 100644
--- a/activerecord/test/cases/yaml_serialization_test.rb
+++ b/activerecord/test/cases/yaml_serialization_test.rb
@@ -1,4 +1,5 @@
-require "cases/helper"
+require 'psych'
+require 'cases/helper'
require 'models/topic'
class YamlSerializationTest < ActiveRecord::TestCase
@@ -36,22 +37,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