christophsturm
03/15/2021, 9:32 AMdescribe("context with dependency lambda", {"StringDependency"}, {/* optional teardown*/}) {
test("test that takes a string dependency") { string ->
expectThat(string).isEqualTo("StringDependency")
}
describe("a child context that uses the parent dependencies. for tests in this context both the parent and this context dependencies are constructed", {parentDependency-> parentDependency+"AddedString"}) {
test("another test that takes a string dependency") { string ->
expectThat(string).isEqualTo("StringDependencyAddedString")
}
}
describe("a child context that does not use the parent dependency. for tests in this context the parent context dependencies are not constructed", {->"TotallyNewString"}) {
test("another test that takes a string dependency") { string ->
expectThat(string).isEqualTo("TotallyNewString")
}
}
}
but I guess in can just use by lazy {} for the parent context dependencies if i really need that.christophsturm
03/15/2021, 2:05 PM