mirror of
https://github.com/lightbend/config.git
synced 2025-01-28 21:20:07 +08:00
Add a test that we search classpath for heuristic include
(heuristic include means no classpath()/file()/url() around it)
This commit is contained in:
parent
b7325ec636
commit
f2ce57af42
2
config/src/test/resources/onclasspath.conf
Normal file
2
config/src/test/resources/onclasspath.conf
Normal file
@ -0,0 +1,2 @@
|
||||
# this is just a file on the classpath that we ensure we can load
|
||||
onclasspath=42
|
@ -1026,4 +1026,17 @@ class PublicApiTest extends TestUtils {
|
||||
conf.getInt("b")
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
def heuristicIncludeChecksClasspath(): Unit = {
|
||||
// from https://github.com/typesafehub/config/issues/188
|
||||
withScratchDirectory("heuristicIncludeChecksClasspath") { dir =>
|
||||
val f = new File(dir, "foo.conf")
|
||||
writeFile(f, """
|
||||
include "onclasspath"
|
||||
""")
|
||||
val conf = ConfigFactory.parseFile(f)
|
||||
assertEquals(42, conf.getInt("onclasspath"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user