mirror of https://github.com/rails/rails
No need to use rescue block to require psych
This commit is contained in:
parent
0bf51e9805
commit
761b049b2e
|
@ -1,8 +1,4 @@
|
|||
begin
|
||||
require 'psych'
|
||||
rescue LoadError
|
||||
end
|
||||
|
||||
require 'yaml'
|
||||
require 'set'
|
||||
require 'active_support/benchmarkable'
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
require 'erb'
|
||||
|
||||
begin
|
||||
require 'psych'
|
||||
rescue LoadError
|
||||
end
|
||||
|
||||
require 'yaml'
|
||||
require 'zlib'
|
||||
require 'active_support/dependencies'
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
begin
|
||||
require 'psych'
|
||||
rescue LoadError
|
||||
end
|
||||
|
||||
require 'erb'
|
||||
require 'yaml'
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
require "cases/helper"
|
||||
require 'psych'
|
||||
require 'cases/helper'
|
||||
require 'models/topic'
|
||||
|
||||
class YamlSerializationTest < ActiveRecord::TestCase
|
||||
|
@ -36,9 +37,6 @@ class YamlSerializationTest < ActiveRecord::TestCase
|
|||
assert_equal({'attributes' => topic.attributes}, coder)
|
||||
end
|
||||
|
||||
begin
|
||||
require 'psych'
|
||||
|
||||
def test_psych_roundtrip
|
||||
topic = Topic.first
|
||||
assert topic
|
||||
|
@ -52,6 +50,4 @@ class YamlSerializationTest < ActiveRecord::TestCase
|
|||
t = Psych.load Psych.dump topic
|
||||
assert_equal topic.attributes, t.attributes
|
||||
end
|
||||
rescue LoadError
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
require 'bigdecimal'
|
||||
|
||||
begin
|
||||
require 'psych'
|
||||
rescue LoadError
|
||||
end
|
||||
|
||||
require 'yaml'
|
||||
|
||||
class BigDecimal
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
begin
|
||||
require 'psych'
|
||||
rescue LoadError
|
||||
end
|
||||
|
||||
require 'yaml'
|
||||
|
||||
YAML.add_builtin_type("omap") do |type, val|
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
require 'psych'
|
||||
require 'abstract_unit'
|
||||
require 'active_support/json'
|
||||
require 'active_support/core_ext/object/to_json'
|
||||
|
@ -291,9 +292,6 @@ 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))
|
||||
|
||||
|
@ -305,8 +303,6 @@ class OrderedHashTest < Test::Unit::TestCase
|
|||
yaml = Psych.dump(@ordered_hash)
|
||||
assert_match '!omap', yaml
|
||||
end
|
||||
rescue LoadError
|
||||
end
|
||||
|
||||
def test_has_yaml_tag
|
||||
@ordered_hash[:array] = %w(a b c)
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
require 'abstract_unit'
|
||||
begin
|
||||
require 'psych'
|
||||
rescue LoadError
|
||||
end
|
||||
|
||||
require 'active_support/core_ext/string/inflections'
|
||||
require 'yaml'
|
||||
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
require 'erb'
|
||||
|
||||
begin
|
||||
require 'psych'
|
||||
rescue LoadError
|
||||
end
|
||||
|
||||
require 'yaml'
|
||||
require 'optparse'
|
||||
require 'rbconfig'
|
||||
|
|
Loading…
Reference in New Issue