From 1c92766bf0b7394057c00f576fce5464a3037fd9 Mon Sep 17 00:00:00 2001 From: hsbt Date: Sat, 20 Oct 2018 04:25:04 +0000 Subject: Merge Pysch-3.1.0.pre2 from ruby/psych. * Added deprecated warnings for the new interface of keyword argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/psych/test_exception.rb | 6 ++++++ test/psych/test_psych.rb | 6 ++++++ test/psych/test_safe_load.rb | 8 ++++++++ test/psych/test_yaml_special_cases.rb | 18 +++++++++--------- 4 files changed, 29 insertions(+), 9 deletions(-) (limited to 'test/psych') diff --git a/test/psych/test_exception.rb b/test/psych/test_exception.rb index 3c72f4a97a..df7fd73740 100644 --- a/test/psych/test_exception.rb +++ b/test/psych/test_exception.rb @@ -15,6 +15,12 @@ module Psych def setup super @wups = Wups.new + + @orig_verbose, $VERBOSE = $VERBOSE, nil + end + + def teardown + $VERBOSE = @orig_verbose end def test_naming_exception diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb index 3a04a3fe70..eeadc864ef 100644 --- a/test/psych/test_psych.rb +++ b/test/psych/test_psych.rb @@ -5,8 +5,14 @@ require 'stringio' require 'tempfile' class TestPsych < Psych::TestCase + + def setup + @orig_verbose, $VERBOSE = $VERBOSE, nil + end + def teardown Psych.domain_types.clear + $VERBOSE = @orig_verbose end def test_line_width_invalid diff --git a/test/psych/test_safe_load.rb b/test/psych/test_safe_load.rb index 82a5f19c36..6c7a8d0f5a 100644 --- a/test/psych/test_safe_load.rb +++ b/test/psych/test_safe_load.rb @@ -3,6 +3,14 @@ require 'psych/helper' module Psych class TestSafeLoad < TestCase + def setup + @orig_verbose, $VERBOSE = $VERBOSE, nil + end + + def teardown + $VERBOSE = @orig_verbose + end + class Foo; end [1, 2.2, {}, [], "foo"].each do |obj| diff --git a/test/psych/test_yaml_special_cases.rb b/test/psych/test_yaml_special_cases.rb index 66448d4efa..4501704030 100644 --- a/test/psych/test_yaml_special_cases.rb +++ b/test/psych/test_yaml_special_cases.rb @@ -17,7 +17,7 @@ module Psych assert_equal [], Psych.load_stream(s) assert_equal false, Psych.parse(s) assert_equal [], Psych.parse_stream(s).transform - assert_equal nil, Psych.safe_load(s) + assert_nil Psych.safe_load(s) end def test_false @@ -49,11 +49,11 @@ module Psych def test_inf s = "-.inf" - assert_equal -Float::INFINITY, Psych.load(s) - assert_equal [-Float::INFINITY], Psych.load_stream(s) - assert_equal -Float::INFINITY, Psych.parse(s).transform - assert_equal [-Float::INFINITY], Psych.parse_stream(s).transform - assert_equal -Float::INFINITY, Psych.safe_load(s) + assert_equal(-Float::INFINITY, Psych.load(s)) + assert_equal([-Float::INFINITY], Psych.load_stream(s)) + assert_equal(-Float::INFINITY, Psych.parse(s).transform) + assert_equal([-Float::INFINITY], Psych.parse_stream(s).transform) + assert_equal(-Float::INFINITY, Psych.safe_load(s)) end def test_NaN @@ -112,11 +112,11 @@ module Psych def test_null s = "null" - assert_equal nil, Psych.load(s) + assert_nil Psych.load(s) assert_equal [nil], Psych.load_stream(s) - assert_equal nil, Psych.parse(s).transform + assert_nil Psych.parse(s).transform assert_equal [nil], Psych.parse_stream(s).transform - assert_equal nil, Psych.safe_load(s) + assert_nil Psych.safe_load(s) end private -- cgit v1.2.3