Skip to content

Commit

Permalink
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/util/URLResource.java
Original file line number Diff line number Diff line change
@@ -163,7 +163,7 @@ public static FileResource createClassloaderURI(Ruby runtime, String pathname) {
}
URL url = cl.getResource(pathname);
String[] files = listClassLoaderFiles(cl, pathname);
return new URLResource(URI_CLASSLOADER + pathname,
return new URLResource(URI_CLASSLOADER + "/" + pathname,
cl,
url == null ? null : pathname,
files);
Empty file added test/relative.rb
Empty file.
1 change: 1 addition & 0 deletions test/require_relative.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require_relative 'relative'
8 changes: 8 additions & 0 deletions test/test_load.rb
Original file line number Diff line number Diff line change
@@ -46,6 +46,14 @@ def test_require
assert $loaded_foo_bar
end

# GH-2972
def test_require_relative_via_uri_classloader_protocol
$CLASSPATH << './test'
assert_nothing_raised do
require 'uri:classloader:/require_relative.rb'
end
end

# JRUBY-3231
def test_load_with_empty_string_in_loadpath
begin

0 comments on commit 562a240

Please sign in to comment.