diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2025-02-26 11:13:41 +0900 |
|---|---|---|
| committer | nagachika <nagachika@ruby-lang.org> | 2025-05-06 14:06:40 +0900 |
| commit | 1c68aae91f43685766ae21485e98e76bfa331857 (patch) | |
| tree | dde2d8007b60b0d15371d5fd9ef804f206cce761 /spec/ruby/core | |
| parent | 54950b1f7c34db61cc922515b726a5d23426a53d (diff) | |
Check LoadError first
The message from dlerror is not our concern.
Diffstat (limited to 'spec/ruby/core')
| -rw-r--r-- | spec/ruby/core/kernel/shared/require.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/ruby/core/kernel/shared/require.rb b/spec/ruby/core/kernel/shared/require.rb index 080409117f..b31c89e3bf 100644 --- a/spec/ruby/core/kernel/shared/require.rb +++ b/spec/ruby/core/kernel/shared/require.rb @@ -223,7 +223,7 @@ describe :kernel_require, shared: true do it "loads c-extension file when passed absolute path without extension when no .rb is present" do # the error message is specific to what dlerror() returns path = File.join CODE_LOADING_DIR, "a", "load_fixture" - -> { @object.send(@method, path) }.should raise_error(Exception, /file too short|not a mach-o file|slice is not valid mach-o file/) + -> { @object.send(@method, path) }.should raise_error(LoadError) end end @@ -231,7 +231,7 @@ describe :kernel_require, shared: true do it "loads .bundle file when passed absolute path with .so" do # the error message is specific to what dlerror() returns path = File.join CODE_LOADING_DIR, "a", "load_fixture.so" - -> { @object.send(@method, path) }.should raise_error(Exception, /load_fixture\.bundle.+(file too short|not a mach-o file|slice is not valid mach-o file)/) + -> { @object.send(@method, path) }.should raise_error(LoadError) end end |
