diff options
author | Hiroshi SHIBATA <[email protected]> | 2021-05-10 19:09:17 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2021-05-10 19:09:43 +0900 |
commit | ab785b28e2f3cc879906aeaee0358c0de478499e (patch) | |
tree | 4e689da9256f3c1653117bf10cf0803276e6f6f3 /test/psych/test_exception.rb | |
parent | bae9a21e40a65c0eaacebfd4b3c3a8de08892c74 (diff) |
[ruby/psych] Use assert_raise instead of assert_raises
https://github.com/ruby/psych/commit/e6ad12b4e1
Diffstat (limited to 'test/psych/test_exception.rb')
-rw-r--r-- | test/psych/test_exception.rb | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/test/psych/test_exception.rb b/test/psych/test_exception.rb index 78601d09c7..4d76081e83 100644 --- a/test/psych/test_exception.rb +++ b/test/psych/test_exception.rb @@ -44,31 +44,31 @@ module Psych end def test_load_takes_file - ex = assert_raises(Psych::SyntaxError) do + ex = assert_raise(Psych::SyntaxError) do Psych.load '--- `' end assert_nil ex.file - ex = assert_raises(Psych::SyntaxError) do + ex = assert_raise(Psych::SyntaxError) do Psych.load '--- `', filename: 'meow' end assert_equal 'meow', ex.file # deprecated interface - ex = assert_raises(Psych::SyntaxError) do + ex = assert_raise(Psych::SyntaxError) do Psych.load '--- `', 'deprecated' end assert_equal 'deprecated', ex.file end def test_psych_parse_stream_takes_file - ex = assert_raises(Psych::SyntaxError) do + ex = assert_raise(Psych::SyntaxError) do Psych.parse_stream '--- `' end assert_nil ex.file assert_match '(<unknown>)', ex.message - ex = assert_raises(Psych::SyntaxError) do + ex = assert_raise(Psych::SyntaxError) do Psych.parse_stream '--- `', filename: 'omg!' end assert_equal 'omg!', ex.file @@ -76,19 +76,19 @@ module Psych end def test_load_stream_takes_file - ex = assert_raises(Psych::SyntaxError) do + ex = assert_raise(Psych::SyntaxError) do Psych.load_stream '--- `' end assert_nil ex.file assert_match '(<unknown>)', ex.message - ex = assert_raises(Psych::SyntaxError) do + ex = assert_raise(Psych::SyntaxError) do Psych.load_stream '--- `', filename: 'omg!' end assert_equal 'omg!', ex.file # deprecated interface - ex = assert_raises(Psych::SyntaxError) do + ex = assert_raise(Psych::SyntaxError) do Psych.load_stream '--- `', 'deprecated' end assert_equal 'deprecated', ex.file @@ -99,7 +99,7 @@ module Psych t.binmode t.write '--- `' t.close - ex = assert_raises(Psych::SyntaxError) do + ex = assert_raise(Psych::SyntaxError) do Psych.parse_file t.path end assert_equal t.path, ex.file @@ -111,7 +111,7 @@ module Psych t.binmode t.write '--- `' t.close - ex = assert_raises(Psych::SyntaxError) do + ex = assert_raise(Psych::SyntaxError) do Psych.load_file t.path end assert_equal t.path, ex.file @@ -123,7 +123,7 @@ module Psych t.binmode t.write '--- `' t.close - ex = assert_raises(Psych::SyntaxError) do + ex = assert_raise(Psych::SyntaxError) do Psych.safe_load_file t.path end assert_equal t.path, ex.file @@ -131,26 +131,26 @@ module Psych end def test_psych_parse_takes_file - ex = assert_raises(Psych::SyntaxError) do + ex = assert_raise(Psych::SyntaxError) do Psych.parse '--- `' end assert_match '(<unknown>)', ex.message assert_nil ex.file - ex = assert_raises(Psych::SyntaxError) do + ex = assert_raise(Psych::SyntaxError) do Psych.parse '--- `', filename: 'omg!' end assert_match 'omg!', ex.message # deprecated interface - ex = assert_raises(Psych::SyntaxError) do + ex = assert_raise(Psych::SyntaxError) do Psych.parse '--- `', 'deprecated' end assert_match 'deprecated', ex.message end def test_attributes - e = assert_raises(Psych::SyntaxError) { + e = assert_raise(Psych::SyntaxError) { Psych.load '--- `foo' } |