[Rspec-devel] Rspec/Test::Unit Integration

Steven R. Baker srbaker at pobox.com
Tue Jul 4 20:07:18 EDT 2006


> I had a conversation with David at the Rails Conference about  
> integrating Rspec into Test::Unit

[snip]

> If Rspec where to user Test::Unit::TestCase to make its assertions,  
> it would be easier to transition into using Rspec from Test::Unit.

This is a very interesting point; David and I discussed this at  
RailsConf as well.  I would have liked to meet you at RailsConf, but  
I wasn't aware of your attendance.  (If we did cross paths in the  
confusion, accept my apologies.)  Be sure to track me down at the  
next one!

Ironically, the first version of RSpec was a wrapper around  
Test::Unit, as you demonstrate.  It started life in this way, and I  
find it amusing that people keep requesting that it wrap Test::Unit  
as a new feature.  (I don't remember why I changed this behaviour,  
but there are many good reasons to have done so.)  It's time for  
discussion.  This is not the first, nor less than the fifth, time  
this has come up that I am aware of.  It also came up at least twice  
on the Argon Express.

An additional benefit of Test::Unit wrappage is that the existing  
tools for Test::Unit will Just Work.  This includes the rake tasks,  
Eclipse plugins, TDDmate, etc, as well as Rails integration,  
autotest, and any other tools that are dependent on Test::Unit.

However...

The main thing we're doing with BDD is changing the language.   
Specifically, removing the test-laden vocabulary from what we're  
actually practicing (and preaching).  Wrapping "testing" frameworks  
so that we can use "testing tools" is probably not a good way to  
spread the word.  Additionally, RSpec is quite a bit faster, and  
significantly less code than Test::Unit.  I consider this to be a  
feature, as well.

I'm not sure that deliberate incompatibility with Test::Unit is a  
good way to proceed, but I'm also not sure that building on top of  
what we're essentially replacing is necessarily better.  I don't  
really have a strong opinion in either direction on this issue,  
though: I see both sides.  Since I'm not particularly partial to one  
side or the other, it should go up for discussion.

RSpec has never been about evangelizing BDD.  From the beginning, it  
has been about enabling BDD.  A framework is no place for evangelism:  
it's a place for enablement.

Specifically, I want to know what the people who are using RSpec  
every day (or often, at least) would like to see.

Thoughts?

-Steven



More information about the Rspec-devel mailing list