diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-05-10 19:09:17 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-05-10 19:09:43 +0900 |
commit | ab785b28e2f3cc879906aeaee0358c0de478499e (patch) | |
tree | 4e689da9256f3c1653117bf10cf0803276e6f6f3 /test/psych/test_parser.rb | |
parent | bae9a21e40a65c0eaacebfd4b3c3a8de08892c74 (diff) | |
download | ruby-ab785b28e2f3cc879906aeaee0358c0de478499e.tar.gz |
[ruby/psych] Use assert_raise instead of assert_raises
https://github.com/ruby/psych/commit/e6ad12b4e1
Diffstat (limited to 'test/psych/test_parser.rb')
-rw-r--r-- | test/psych/test_parser.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/psych/test_parser.rb b/test/psych/test_parser.rb index e8225dabb6..3604e7c985 100644 --- a/test/psych/test_parser.rb +++ b/test/psych/test_parser.rb @@ -63,7 +63,7 @@ module Psych parser = Psych::Parser.new klass.new 2.times { - assert_raises(RuntimeError, method.to_s) do + assert_raise(RuntimeError, method.to_s) do parser.parse yaml end } @@ -77,7 +77,7 @@ module Psych end def test_filename - ex = assert_raises(Psych::SyntaxError) do + ex = assert_raise(Psych::SyntaxError) do @parser.parse '--- `', 'omg!' end assert_match 'omg!', ex.message @@ -180,7 +180,7 @@ module Psych def o.external_encoding; nil end def o.read len; self end - assert_raises(TypeError) do + assert_raise(TypeError) do @parser.parse o end end @@ -193,23 +193,23 @@ module Psych end def test_syntax_error - assert_raises(Psych::SyntaxError) do + assert_raise(Psych::SyntaxError) do @parser.parse("---\n\"foo\"\n\"bar\"\n") end end def test_syntax_error_twice - assert_raises(Psych::SyntaxError) do + assert_raise(Psych::SyntaxError) do @parser.parse("---\n\"foo\"\n\"bar\"\n") end - assert_raises(Psych::SyntaxError) do + assert_raise(Psych::SyntaxError) do @parser.parse("---\n\"foo\"\n\"bar\"\n") end end def test_syntax_error_has_path_for_string - e = assert_raises(Psych::SyntaxError) do + e = assert_raise(Psych::SyntaxError) do @parser.parse("---\n\"foo\"\n\"bar\"\n") end assert_match '(<unknown>):', e.message @@ -219,7 +219,7 @@ module Psych io = StringIO.new "---\n\"foo\"\n\"bar\"\n" def io.path; "hello!"; end - e = assert_raises(Psych::SyntaxError) do + e = assert_raise(Psych::SyntaxError) do @parser.parse(io) end assert_match "(#{io.path}):", e.message |