diff options
author | SHIBATA Hiroshi <hsbt@ruby-lang.org> | 2017-03-10 11:00:23 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-10 11:00:23 +0900 |
commit | 73dec1f56f2b916c7bf07217725a329ee664cf1e (patch) | |
tree | c9469304416b3c39b586b498458d6b137f66e817 /test | |
parent | 42c3df6569628b295af28c85c6317cab38b443b1 (diff) | |
parent | 55cd0c19eb7eae580fe38b51735d6c27680d94e7 (diff) | |
download | psych-73dec1f56f2b916c7bf07217725a329ee664cf1e.zip |
Merge pull request #304 from ruby/remove-syck
Remove deprecated code related syck
Diffstat (limited to 'test')
-rw-r--r-- | test/psych/helper.rb | 10 | ||||
-rw-r--r-- | test/psych/test_deprecated.rb | 39 |
2 files changed, 7 insertions, 42 deletions
diff --git a/test/psych/helper.rb b/test/psych/helper.rb index 0474cf1..7b564bd 100644 --- a/test/psych/helper.rb +++ b/test/psych/helper.rb @@ -50,10 +50,10 @@ module Psych def assert_to_yaml( obj, yaml ) assert_equal( obj, Psych::load( yaml ) ) assert_equal( obj, Psych::parse( yaml ).transform ) - assert_equal( obj, Psych::load( obj.psych_to_yaml ) ) - assert_equal( obj, Psych::parse( obj.psych_to_yaml ).transform ) + assert_equal( obj, Psych::load( obj.to_yaml ) ) + assert_equal( obj, Psych::parse( obj.to_yaml ).transform ) assert_equal( obj, Psych::load( - obj.psych_to_yaml( + obj.to_yaml( :UseVersion => true, :UseHeader => true, :SortKeys => true ) )) @@ -73,11 +73,11 @@ module Psych if obj.nil? assert_nil Psych.load(v.tree.yaml) assert_nil Psych::load(Psych.dump(obj)) - assert_nil Psych::load(obj.psych_to_yaml) + assert_nil Psych::load(obj.to_yaml) else assert_equal(obj, Psych.load(v.tree.yaml)) assert_equal(obj, Psych::load(Psych.dump(obj))) - assert_equal(obj, Psych::load(obj.psych_to_yaml)) + assert_equal(obj, Psych::load(obj.to_yaml)) end end diff --git a/test/psych/test_deprecated.rb b/test/psych/test_deprecated.rb index a806f6b..c2db0c5 100644 --- a/test/psych/test_deprecated.rb +++ b/test/psych/test_deprecated.rb @@ -8,47 +8,12 @@ module Psych Psych.domain_types.clear end - class QuickEmitter - attr_reader :name - attr_reader :value - - def initialize - @name = 'hello!!' - @value = 'Friday!' - end - - def to_yaml opts = {} - Psych.quick_emit object_id, opts do |out| - out.map taguri, to_yaml_style do |map| - map.add 'name', @name - map.add 'value', nil - end - end - end - end + class QuickEmitter; end def setup - @qe = QuickEmitter.new @orig_verbose, $VERBOSE = $VERBOSE, false end - def test_quick_emit - qe2 = Psych.load @qe.to_yaml - assert_equal @qe.name, qe2.name - assert_instance_of QuickEmitter, qe2 - assert_nil qe2.value - end - - def test_recursive_quick_emit - hash = { :qe => @qe } - hash2 = Psych.load Psych.dump hash - qe = hash2[:qe] - - assert_equal @qe.name, qe.name - assert_instance_of QuickEmitter, qe - assert_nil qe.value - end - class QuickEmitterEncodeWith attr_reader :name attr_reader :value @@ -149,7 +114,7 @@ module Psych class YamlAs TestCase.suppress_warning do - psych_yaml_as 'helloworld' # this should be yaml_as but to avoid syck + yaml_as 'helloworld' end end |