diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-02-04 15:21:49 +0900 |
---|---|---|
committer | NARUSE, Yui <naruse@airemix.jp> | 2020-03-13 22:34:09 +0900 |
commit | c7e0ce67430b5e312eb626a2c2f4b6a810b3b68b (patch) | |
tree | a0ad092c4501cfde64795ab3ef7dd01c7b452965 /test/ruby/test_require.rb | |
parent | 7518b4e945675df9aca223c30ca711e1d82341ec (diff) |
Add the loaded feature after no exception raised
Retrying after rescued `require` should try to load the same
library again. [Bug #16607]
(cherry picked from commit 7d6903dc476f982e7b432adbeef3a3d9372a309f)
Diffstat (limited to 'test/ruby/test_require.rb')
-rw-r--r-- | test/ruby/test_require.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb index 05dc18cd17..a86ea356c5 100644 --- a/test/ruby/test_require.rb +++ b/test/ruby/test_require.rb @@ -214,6 +214,13 @@ class TestRequire < Test::Unit::TestCase assert_syntax_error_backtrace {|req| require req} end + def test_require_syntax_error_rescued + assert_syntax_error_backtrace do |req| + assert_raise_with_message(SyntaxError, /unexpected/) {require req} + require req + end + end + def test_load_syntax_error assert_syntax_error_backtrace {|req| load req} end |