summaryrefslogtreecommitdiff
path: root/test/paths_test.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2023-04-30 22:30:07 -0600
committerGitHub <noreply@github.com>2023-04-30 22:30:07 -0600
commit5559941eb0bb23e72f2b64226415e071e257c347 (patch)
treebf9ccbf09f7931d142fc207e290306aef88b9e2a /test/paths_test.rb
parent72259cb282fc80b5f9b30f25e9674ff2ef2c3f71 (diff)
resolves #3929 treat uri:classloader: as absolute path prefix when running on JRuby (PR #4444)
Diffstat (limited to 'test/paths_test.rb')
-rw-r--r--test/paths_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/paths_test.rb b/test/paths_test.rb
index a3a68daf..e21bff75 100644
--- a/test/paths_test.rb
+++ b/test/paths_test.rb
@@ -284,6 +284,18 @@ context 'Path Resolver' do
assert_equal '//server/docs/output.html', @resolver.system_path('//server/docs/output.html')
end
+ test 'resolves classloader path if start is classloader path and target is relative', if: jruby? do
+ assert_equal 'uri:classloader:images/sample.png', @resolver.system_path('sample.png', 'uri:classloader:images')
+ end
+
+ test 'resolves classloader path if start is root-relative classloader path and target is relative', if: jruby? do
+ assert_equal 'uri:classloader:/images/sample.png', @resolver.system_path('sample.png', 'uri:classloader:/images')
+ end
+
+ test 'preserves classloader path if start is absolute path and target is classloader path', if: jruby? do
+ assert_equal 'uri:classloader:/images/sample.png', @resolver.system_path('uri:classloader:/images/sample.png', '/home/doctor/docs')
+ end
+
test 'resolves relative target relative to current directory if start is empty' do
pwd = File.expand_path Dir.pwd
assert_equal "#{pwd}/images/tiger.png", @resolver.system_path('images/tiger.png', '')