File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -194,9 +194,12 @@ class IOUtils extends SpringIOUtils {
194194 String rootPath = classRes. toString() - pathToClassFile
195195 if (rootPath. endsWith(BuildSettings . BUILD_CLASSES_PATH )) {
196196 rootPath = rootPath. replace(' /build/classes/groovy/' , ' /build/resources/' )
197- } else {
197+ }
198+
199+ if (! rootPath. endsWith(' /' )) {
198200 rootPath = " $rootPath /"
199201 }
202+
200203 return new URL (rootPath)
201204 }
202205 return null
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ package grails.io
2121import org.grails.io.support.Resource
2222import spock.lang.Specification
2323
24- class IOUtilsSpec extends Specification {
24+ class IOUtilsSpec extends Specification {
2525
2626 void " Test findClassResource finds a class resource" () {
2727 expect :
@@ -34,4 +34,13 @@ class IOUtilsSpec extends Specification{
3434 IOUtils . findJarResource(Specification )
3535 IOUtils . findJarResource(Specification ). path. endsWith(' spock-core-2.3-groovy-3.0.jar!/' )
3636 }
37+
38+ void ' findRootResourcesURL - appends / if not present' () {
39+ when :
40+ def result = IOUtils . findRootResourcesURL(IOUtils ). toString()
41+
42+ then :
43+ result. startsWith(' file:' )
44+ result. endsWith(' /' )
45+ }
3746}
You can’t perform that action at this time.
0 commit comments