Closed jackfirth closed 7 years ago
Brainstorm v2: the with-fixture
option would definitely be simpler, and it wouldn't require redefining test-begin
/ test-case
/ test-suite
etc:
(test-begin
(with-fixture [foo]
(check-equal? #"blah" (file->bytes (foo)))))
This requires each test declare individual fixtures, and makes it painful to use the same fixtures across a whole bunch of tests. However, those tests could be grouped into a single test with nested tests instead, or some other mechanism could be provided.
Done in separate package.
Given a bunch of test cases, it should be possible to define a fixture
foo
that contains a disposable. Each test case should get its own instance of the fixture, and the value of the fixture should be added to the check information stack of all checks in test cases using the fixture. This might look something like this:...which should fail while looking something like this:
Allowing fixtures to depend on other fixtures might be important as well. Additionally, defining lists of fixtures statically might be useful, or defining some sort of simpler
with-fixtures
building block that can be abstracted over.