Orb

Orb is a magical tool for interactively building tests.

The gist: You insert orb! into your test file, then run your tests. When the runner gets to that line, it will open a REPL where you can interact with the environment and build up a test to be written back to the file.

Orb is still a work in progress. It does not currently actually write back to the test file, but it will format a test to be pasted in.

Usage

The first step, after adding gem "orb" to your Gemfile, is to insert orb! in the class body of a TestCase, then run your tests. Once the repl appears, you will have access to the following commands, in addition to the functionality of a typical IRB (pry, really) prompt:

,a: Append the last line you ran in the REPL to the Buffer.

,p: Print the current contents of the Buffer.

,e: Edit the buffer in ENV['EDITOR'].

,r: Run the entire buffer again.

,n: Give a name to the current test. Called like ,n music is loud.

,w: Print a version of the buffer suitable for pasting back into the test file. Eventually this will modify the test file with the new test.

Within the context of the REPL, assertions are evaluated immediately, rather than being deferred until later in the run. This lets you run assertions at the REPL and get meaningful results. nil indicates success; and error indicates and describes failure.

Screencast

Coming soon!

License

MIT