I follow the readme of creating a seam so you get nice isolated class you can easily test. Then I would suggest to write a lot of tests, understand the code and then refactor and ensure your test still pass.
No need for a gem like this. As others point out for functional small pieces of code this might work but api endpoints I'll rather go with a "add tests" approach