Marnen Laibow-Koser wrote:

>> Despite Rails being the only Web platform designed for TDD, 
> 
> Really?  I have the impression that there are others...if nothing else, 
> some of the Railsy PHP frameworks have copied this feature.

designed for - not copied on.

>> Most importantly, tests should run instantly. 
> 
> In most cases, mine do.  The exceptions are those which use regexps or 
> DOM wizardry for parsing HTML.  I suspect Oniguruma might help here, but 
> I haven't tried it.

Rails??

> RSpec + autotest + out-of-the-box test scripts + any editor you like. 
> Done.

When the tests fail, what button do you type to navigate instantly to the test 
failure?

>> The Rails problem is apparently rake db:test:prepare, which clones your 
>> database
>> instead of detecting whether it needs a clone.
> 
> When would it *not* need a clone?  Tests are supposed to start from a 
> clean environment.

We do not build a new CPU with new libraries and Ruby installation between each 
test run. All test isolation is a trade-off of some kind.

> Jay Fields has posted some stuff on his blog about how to make Rails 
> unit tests not touch the DB, but I don't really see much need to do 
> that.

Thanks - that's the next thing I was going to ... rail at. Some consultants who 
teach TDD use a mind-trick to motivate their newbs to decouple their code. In a 
big-iron environment where database _migrations_ are expensive, until you pay 
that down, you can get a slight benefit to unit tests that reach into code that 
decouples from the database.

We should do that too. And when we need a fixture, to start such a test case, 
it 
should come from the database.

-- 
   Phlip


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to