Add `quit()` method and a test