Hi all,
I would like to propose `ExUnit.rerun(list_of_modules)` to rerun test modules.
Use CaseAs far as I could think off, it is only useful in the context of Livebook notebook.
Often times, when writing a tutorial in Livebook, I want to write a test case for
the users so they could interactively write some code to make it pass. This is especially
helpful when we use Livebook as a teaching medium.
Currently, there are no ways to support ruruning a test without rewriting it. I have tried using Livebook branch out section but have no luck as well.
Current Hack
Currently, one can still achieve that by using Module.create/3 with ExUnit.run/1. Here's a Livebook
notebook to demonstrate it, or you can run it
here.
This work since we are essentially defining a "new" module.
Minimal working changes
Here's a
gist that I quickly hack on to implement it. It's not perfect but seems to be working.
The Livebook twitter account suggested sending a PR here, but I guess let me propose it here first.