aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/ordered_hash_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 /activesupport/test/ordered_hash_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 'activesupport/test/ordered_hash_test.rb')
-rw-r--r--activesupport/test/ordered_hash_test.rb22
1 files changed, 9 insertions, 13 deletions
diff --git a/activesupport/test/ordered_hash_test.rb b/activesupport/test/ordered_hash_test.rb
index 8119b36491..841088e7e7 100644
--- a/activesupport/test/ordered_hash_test.rb
+++ b/activesupport/test/ordered_hash_test.rb
@@ -1,3 +1,4 @@
+require 'psych'
require 'abstract_unit'
require 'active_support/json'
require 'active_support/core_ext/object/to_json'
@@ -291,21 +292,16 @@ class OrderedHashTest < Test::Unit::TestCase
assert_equal @ordered_hash.values, @deserialized_ordered_hash.values
end
- begin
- require 'psych'
+ def test_psych_serialize
+ @deserialized_ordered_hash = Psych.load(Psych.dump(@ordered_hash))
- def test_psych_serialize
- @deserialized_ordered_hash = Psych.load(Psych.dump(@ordered_hash))
-
- values = @deserialized_ordered_hash.map { |_, value| value }
- assert_equal @values, values
- end
+ values = @deserialized_ordered_hash.map { |_, value| value }
+ assert_equal @values, values
+ end
- def test_psych_serialize_tag
- yaml = Psych.dump(@ordered_hash)
- assert_match '!omap', yaml
- end
- rescue LoadError
+ def test_psych_serialize_tag
+ yaml = Psych.dump(@ordered_hash)
+ assert_match '!omap', yaml
end
def test_has_yaml_tag