Commit f33a18c0 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Add test for default value

parent 5cf87e94
......@@ -31,6 +31,7 @@ class ConfigurableTest extends TestNGSuite with MockitoSugar with Matchers {
intercept[IllegalStateException] {
classC.get("notexist", required = true)
}
classC.get("notexist", default = "default").asString shouldBe "default"
classC.get("k1", freeVar = false).asString shouldBe "c1"
classC.classB.get("k1", freeVar = false).asString shouldBe "b1"
......@@ -42,7 +43,6 @@ abstract class Cfg extends Configurable {
def get(key: String, default: String = null, submodule: String = null, required: Boolean = false, freeVar: Boolean = true) = {
config(key, default, submodule, required, freeVar = freeVar)
}
}
class ClassA(val root: Configurable) extends Cfg
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment