summaryrefslogtreecommitdiff
path: root/test/psych/test_exception.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-27 00:44:04 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-27 00:44:04 +0000
commit867581dd755bd202cefc605af5e081ba2ba8c1ec (patch)
tree60b9cfa3907cdddfbd5d3ca840a9c6eb32935e50 /test/psych/test_exception.rb
parente0311eb847bfa1c526aac4485889548ad8152ce3 (diff)
Merge psych-3.1.0.pre1.
* Update bundled libyaml-0.2.1 from 0.1.7. https://github.com/ruby/psych/pull/368 * Unify Psych's API: To use keyword arguments with method call. https://github.com/ruby/psych/pull/358 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/psych/test_exception.rb')
-rw-r--r--test/psych/test_exception.rb26
1 files changed, 22 insertions, 4 deletions
diff --git a/test/psych/test_exception.rb b/test/psych/test_exception.rb
index 3040bfb7a2e..3c72f4a97aa 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