On 6/7/05, Jacob Fugal <lukfugl / gmail.com> wrote:
> Disclaimer: I've never actually used ZenTest, so I may be wrong, but
> having read a little about it this is my understanding...

Anti-disclaimer:  the description below is pretty accurate for Ruby 
code -> tests via ZenTest

> 
> > But I have a question. The article is entitled 'Test-first programming
> > with Ruby' but when talking about ZenTest you tell that it "can also
> > work in reverse, loading a test suite and writing code stubs for every
> > test" which corresponds to what this is all about. However the examples
> > you are showing after that are examples to go from code to tests. Why
> > didn't you show how to go from tests to code using ZenTest?
> 
> I believe that you are misinterpreting the (admittedly ambiguous)
> statement "loading a test suite and writing code stubs for every
> test". From my understanding of ZenTest, the noun "test suite" would
> refer to the code base to be tested plus any existing tests, and the
> "code stubs" are stubs for new tests, not stubs for the code being
> tested. E.g. my code has a method 'eatTaquitos' which isn't yet tested
> in my existing test suite. ZenTest will detect that and create a stub
> 'test_eatTaquitos' (or some other, probably better, name) method. It's
> a stub because ZenTest isn't smart enought to know *how* to test
> 'eatTaquitos', just that it still *needs* to be tested.
> 
> Does that clear up the confusion? (Or, if I'm totally off base, will
> someone familiar with ZenTest clean up the mess I just made?)

ZenTest is capable of 'working in reverse' too though.  If you've written a
nice test suite but haven't gotten around to writing code yet, ZenTest will
gleefully write stubs for the code.  In fact, you could hand ZenTest a file 
full of tests and a file full of code, and it will pump out test method stubs 
for any untested methods and methods stubs to match any tests for which 
no methods currently exist.  (Have I successfully undisambiguated things?)

> 
> Jacob Fugal
> 
> 


-- 
thanks,
-pate
-------------------------
We are often unable to tell people what they need to know, because 
they want to know something else, and would therefore only 
misunderstand what we said
- the Raven   (George MacDonald, Lilith)