[rspec-devel] Using Test::Unit::AutoRunner to run Example Suite

Brian Takita brian.takita at gmail.com
Sun Sep 9 06:53:05 EDT 2007

I just checked in a change that makes Test::Unit's AutoRunner run all
of the examples you have defined. This is in accordance with our
effort to build rspec on top of Test::Unit.

The at_exit callback defined in Kernel#behaviour_runner has been
removed in preference of using Test::Unit's at_exit callback.

This means you will be able to run Test::Unit tests and rspec examples
within the same suite! Of course there are some rough edges that need
to be smoothed out, but in most cases it should work.

We are still using rspec's Reporter and BehaviourRunner to write to output.
The Test::Unit::UI::TestRunnerMediator has been extended to get the
rspec summary printed.

BehaviourRunner#run is still available and used in rspec's pre_commit process.

To try out the Test::Unit runner, simply execute one of the examples
in rspec. Here is the output of an example. There is a
Test::Unit::TestCase and an Example in this file. Notice that the
summarys are separate.

Loaded suite /home/btakita/workspace/rspec/rspec/spec/spec/runner/test_unit_and_rspec_spec
Finished in 0.000552 seconds.

1 tests, 1 assertions, 0 failures, 0 errors

Finished in 0.000534 seconds

1 example, 0 failures

I also created an ExampleSuite class, that subclasses TestSuite.
I will be going on vacation until next Wednesday. I hope this works
out for everybody. Please take a look at the code. I may be a little
slow in responding to your emails though, for the next week and a
half, though.


More information about the rspec-devel mailing list