Skip to content

Commit 3848302

Browse files
author
R. Tyler Croy
committed
Properly encode our test file URLs
Discovered this when running tests in a directory which has a space in the path. File.toURL() is deprecated in the JDK anyways: This method does not automatically escape characters that are illegal in URLs. It is recommended that new code convert an abstract pathname into a URL by first converting it into a URI, via the toURI method, and then converting the URI into a URL via the URI.toURL method. Fixes #280
1 parent aa03efb commit 3848302

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

jruby-gradle-base-plugin/src/integTest/groovy/com/github/jrubygradle/JRubyExecExtensionIntegrationSpec.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ class JRubyExecExtensionIntegrationSpec extends Specification {
9393
}
9494

9595
then:
96-
outputBuffer == "[\"${new File(TEST_JARS_DIR, 'org/bouncycastle/bcprov-jdk15on/1.46/bcprov-jdk15on-1.46.jar').toURL()}\"]"
96+
def outputFile = new File(TEST_JARS_DIR, 'org/bouncycastle/bcprov-jdk15on/1.46/bcprov-jdk15on-1.46.jar')
97+
outputBuffer == "[\"${outputFile.toURI().toURL()}\"]"
9798
}
9899

99100
def "Running a script that requires a gem, a separate jRuby and a separate configuration"() {

0 commit comments

Comments
 (0)