Add a test that we search classpath for heuristic include

(heuristic include means no classpath()/file()/url() around it)
This commit is contained in:
Havoc Pennington 2015-03-06 21:27:50 -05:00
parent b7325ec636
commit f2ce57af42
2 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,2 @@
# this is just a file on the classpath that we ensure we can load
onclasspath=42

View File

@ -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"))
}
}
}