error fixture-yield
В фикстуре нет `yield`.
What it means#
A fixture (fixture name(params) -> T { … }) sets something up, hands a value to the test with yield value and cleans up
afterwards: the statements after the yield run when the test has finished, also when it failed or panicked (§18.2).
A fixture body without any yield has nothing to give to test … with name as v.
Example#
fixture tempDir() -> str {
print("setup") // <- fixture-yield: no `yield`
"t"
}
test "uses the fixture" with tempDir as dir {
assert dir == "t"
}error
fixture-yield
How to fix#
fixture tempDir() -> str {
print("setup")
yield "t" // the test runs here
print("cleanup")
}
test "uses the fixture" with tempDir as dir {
assert dir == "t"
}