[rspec-users] restful_auth and good rspec examples (was: Caboosers drop RSpec)

Jim Gay jim at saturnflyer.com
Tue Nov 4 15:58:22 EST 2008

On Nov 4, 2008, at 3:01 PM, Ben Mabey wrote:

> Fernando Perez wrote:
>> As a starter, can someone tell me if the specs defined in  
>> restful_authentication are clever? Can I learn from them?
> Please don't look at restful_auth as an example on how to use rspec  
> examples and/or the story runner.  The stories in particular are  
> very brittle.
>> Because right now I find them overwhelming, complicated, over- 
>> testing, etc.
> Yeah, they go a little overboard with keeping the specs DRY which  
> results IMO hard to follow specs.  They also test private methods  
> directly and some other things which are TDD smells.
>> Does anyone know of a good app with specs I could learn from? It  
>> always makes me laugh to think about all the good things people say  
>> about TDD, and if I take for instance Spree (a Ror ecommerce  
>> website), well the specs are almost not defined at all, whereas the  
>> code is present.
> Hmm.. I've heard good things about Radiant (the CMS) but I haven't  
> looked too closely myself.

Don't look too closely. There's lots of coverage, but the tests were  
converted from Test::Unit, so it wasn't done in traditional BDD, but  
we're moving to clear up the behavior descriptions which are  
lackluster. They'll be getting better.
I have a branch where I'm trying to clear this up, but I've not worked  
on it in weeks (and it lags behind edge as a result) http://github.com/saturnflyer/radiant/tree/spec

Perhaps this'll be the impetus to get it going again.

> Also, the rspec code base itself is a very good place to learn  
> from.  I think there are plenty of open-source tools that use rspec  
> that you can learn from but I can't seem to think of many open- 
> source rails apps with stellar examples.
> I have been thinking for a while that a worthwhile project would be  
> to fork restful_auth and add some clearer code examples (specs) and  
> Cucumber features.  Since so many rails developers start out with  
> restful auth it would be a good way to illustrate some good rspec  
> guidelines.  Alas, I have been think this for a while but have done  
> nothing... It has been one of those things on my endless OSS TODO  
> lists.
> -Ben

More information about the rspec-users mailing list