Module
poke/fixture
src/poke/fixture.pookaBorrow a resource, and return it even when a test fails. Cleanup runs for successful callbacks and exceptions. Abrupt process death cannot run an after block; the temporary root is kept under build for that case.
API reference
with_resource(setup: fn() -> a, cleanup: fn(a) -> Nil, run: fn(a) -> b) -> b
INFERRED
fn(fn() -> a, fn(a) -> Nil, fn(a) -> b) -> bSetup runs once. Cleanup runs once after the callback, including on failure.
with_directory(run: fn(String) -> a) -> a
INFERRED
fn(fn(String) -> a) -> aEach callback owns a fresh directory. It and its contents are removed on exit.
fixture.with_directory(fn(path) { should.be_ok(file.write(path + "/note", "hello")) })