diff options
author | Greg Houle <greg.houle@shopify.com> | 2018-04-23 13:53:30 -0400 |
---|---|---|
committer | Greg Houle <greg.houle@shopify.com> | 2018-07-13 14:17:46 -0400 |
commit | 4d4439d6d0adfcbd211ea295779315f1baa7dadd (patch) | |
tree | 469e905f601cb7c50de3a02dc915a5eed4dc1bda /test/psych/test_exception.rb | |
parent | 1cc38947ac7dd7239a502f639ecbbec99c0732bb (diff) | |
download | psych-4d4439d6d0adfcbd211ea295779315f1baa7dadd.zip |
unifying interface of Psych
Diffstat (limited to 'test/psych/test_exception.rb')
-rw-r--r-- | test/psych/test_exception.rb | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/test/psych/test_exception.rb b/test/psych/test_exception.rb index 3040bfb..3c72f4a 100644 --- a/test/psych/test_exception.rb +++ b/test/psych/test_exception.rb @@ -30,9 +30,15 @@ module Psych assert_nil ex.file ex = assert_raises(Psych::SyntaxError) do - Psych.load '--- `', 'meow' + Psych.load '--- `', filename: 'meow' end assert_equal 'meow', ex.file + + # deprecated interface + ex = assert_raises(Psych::SyntaxError) do + Psych.load '--- `', 'deprecated' + end + assert_equal 'deprecated', ex.file end def test_psych_parse_stream_takes_file @@ -43,7 +49,7 @@ module Psych assert_match '(<unknown>)', ex.message ex = assert_raises(Psych::SyntaxError) do - Psych.parse_stream '--- `', 'omg!' + Psych.parse_stream '--- `', filename: 'omg!' end assert_equal 'omg!', ex.file assert_match 'omg!', ex.message @@ -57,9 +63,15 @@ module Psych assert_match '(<unknown>)', ex.message ex = assert_raises(Psych::SyntaxError) do - Psych.load_stream '--- `', 'omg!' + Psych.load_stream '--- `', filename: 'omg!' end assert_equal 'omg!', ex.file + + # deprecated interface + ex = assert_raises(Psych::SyntaxError) do + Psych.load_stream '--- `', 'deprecated' + end + assert_equal 'deprecated', ex.file end def test_parse_file_exception @@ -94,9 +106,15 @@ module Psych assert_nil ex.file ex = assert_raises(Psych::SyntaxError) do - Psych.parse '--- `', 'omg!' + Psych.parse '--- `', filename: 'omg!' end assert_match 'omg!', ex.message + + # deprecated interface + ex = assert_raises(Psych::SyntaxError) do + Psych.parse '--- `', 'deprecated' + end + assert_match 'deprecated', ex.message end def test_attributes |