Andrew Arrow wrote:
> It doesn't reload stuff like route changes or changes to environmnet.rb, 
> but that's okay.  

It's only OK if you're absolutely 100% certain that you'll never change 
any routes or environment values in the course of your test code.

[...]
>> If your old test has side effects (such as DB operations!) that are not 
>> cleaned up, then it will influence the new test.  It's not just about 
> 
> This is for unit tests only, no DB access.

I used DB access as a common example, not as the only thing.  Basically, 
if your test could change system state *at all*, then you need to start 
from scratch each time.

> 
>> I agree that reloading the environment can sometimes ve a bit slow.  But 
>> you've got to do it if you want reliable tests.
> 
> I disagree.  I think 10 seconds is completely un-acceptable to do proper 
> test-driven development.

That may be, but you've still got to do it.  If you don't like the time 
delay, fix it (perhaps you can shrink what your environment files do?).

>  Since using this new system I write much 
> better unit tests because I have the freedom to run it over and over and 
> over after every small change.

But you don't know whether your tests are properly isolated, and 
therefore they are not reliable.

> 
> Just like you don't have to start and stop your webserver when making 
> changes in development mode.  

You *do* have to start and stop it if you change the environment files.

> So you make a change, and can refresh the 
> browser and see it right away.  I want that same freedom in tests. 

Autotest will give you that, if you can lick the problem with the slow 
load time.  Perhaps the ZenTest developers would have some good ideas?

> Because that's what makes me NOT want to write the test.  Because I know 
> I can see the change right away in the browser.

Sure you can, but without tests, how do you know it really does what you 
expect?  It's considerations like that that keep me writing tests.

I understand what you're trying to do here, and I sympathize.  But I 
think it's unreasonable to expect that you can do any sort of acceptable 
unit testing without reloading the environment.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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