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:25 +0900 |
commit | e6ad12b4e15dd11232d591b9faedcc9ca2b50af6 (patch) | |
tree | d824d222f328f80071a3c11f245aa3d8a2bbcf91 /test/psych/test_exception.rb | |
parent | ef8bb17f2572792b6ae8e797417bdfa57f7af41e (diff) | |
download | psych-e6ad12b4e15dd11232d591b9faedcc9ca2b50af6.tar.gz |
Use assert_raise instead of assert_raises
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 78601d0..4d76081 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' } |