[Rspec-devel] Skeleton Generator

Steven R. Baker srbaker at pobox.com
Fri Aug 11 18:40:38 EDT 2006


> What I'd been considering working on under Test::Unit (and was  
> dissuaded
> by it's byzantine internals) was a skeleton code generation tool.   
> Short
> form: write your specs with the knowledge that they'll fail.  The spec
> runner catches NameError and NoMethodError and starts constructing the
> basic skeleton of actual classes, until specs fail for other reasons.

I think a tool to do this for Test::Unit is already in ZenTest.  I  
know there's one that goes the other way.

> The driving motivation here is the same as automated testing: the  
> easier
> it is to do, the more I'll do it.  And if I can get the class and  
> method
> definitions started for the price of writing starter specs, not  
> only is
> it easier (because I cut out the "write the class defs to that the  
> test
> doesn't fail there" steps) , but I actually get work done for me.   
> Time
> profit!
>
> Now, I anticipate that there'll be a bunch of spongy problems to solve
> in attempting this, but the reason I post the idea here is: is this
> something the the larger community would be interested in, and  
> might it
> have a home in rspec eventually?

This is probably a desirable feature for many would-be users, but it  
really defeats the purpose of what we're trying to do.  It removes  
the "Driven" part.  If you're writing more than one spec/example/ 
behaviour at a time, then you're writing code to make more than one  
pass.

-Steven





More information about the Rspec-devel mailing list