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.
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
: Write the buffer back to the test file in place of the call to
orb!
.
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.
TODO
- Screencast
- MiniTest/RSpec support
- Mocha/etc. integration -- assertions can't fire immediately.
License
MIT