weaver-test
weaver-test copied to clipboard
ForEachTest resource
Add IOForEachSuite as a way to acquire a new instance of a resource for each test in a suite.
Combining this with global makes it possible to do things that I have not seen in other test frameworks, for instance having the global scope setting up a Database provider and shutting it safely down after all tests are done, but still allowing tests to be written across multiple files, without dependencies on each other and with every test getting a fresh database.
I have tried to implement and test this pattern in UniqueResourceSuite
and SharedResourceSuite
.
If this is something you want to move forward with I would be happy to look at adding it to the docs.
@amumurst hi, and thanks for the contribution ! This feature had been requested by several people and was on my backlog, so the PR makes me happy.
I'm gonna take some time (probably tomorrow) to give it a proper read and reflect about the implications of your implementation, but at the very least I can tell you that there is interest 😄
Any plans to bring this feature to the project?