mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
6f968cab15
* load.c (rb_load_protect): fix the condition to load the found file. fixup of r59155. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
14 lines
352 B
Ruby
14 lines
352 B
Ruby
# frozen_string_literal: true
|
|
require 'test/unit'
|
|
require '-test-/load/protect'
|
|
|
|
class Test_Load_Protect < Test::Unit::TestCase
|
|
def test_load_protect
|
|
assert_raise(LoadError) {
|
|
Bug.load_protect(__dir__+"/nonexistent.rb")
|
|
}
|
|
assert_raise_with_message(RuntimeError, "foo") {
|
|
Bug.load_protect(__dir__+"/script.rb")
|
|
}
|
|
end
|
|
end
|