> I completely disagree.  RSpec works very well, and its syntax is 
> generally more natural (at least to me) than Test::Unit.  In what way 
> does RSpec not work for you?

Each time I would write a test, something would go wrong in the spec, 
specially when specing controllers, so I only speced models. With 
Test::Unit everything works well and I can test my controllers and views 
so easily, I definitely don't need to watch any screencast to teach me 
how it works.

Moreover to my great surprise, Test::Unit's syntax is now pretty so you 
can write:

test "..." do

end

And behind the scenes it transforms it into def 
my_cool_test_with_plenty_underscores

I prefer 100 times test::unit to rspec, and when people ask about which 
tool to use, I recommend test::unit and I am glad to share my experience 
in testing so people won't do the same mistakes I did.

> Again, I disagree 100%.  I find it extremely helpful to get immediate 
> feedback when my tests break.  If you find autospec "distracting", I 
> wonder if you're really paying enough attention to your tests...
No autospec is distracting as you often find yourself waiting for the 
test result, I won't even talk about growl which makes things even 
worse.

I got fed up when saving 3 files quickly and one after the other just 
because I did some indentation editing. Autospec would then run 3 times 
for nothing! Waste of time and resource. I prefer to run my tests 
manually.

> Yes, but don't go through silly contortions to religiously avoid the DB 
> altogether if it's more trouble than it's worth.
You are right. But for instance, instead of update_attributes I prefer 
to set the attributes and then call save! which I can stub in a test and 
still have the attributes get set, assert their values and save a slow 
DB hit.

By doing this I divided by 10 my testing time!!! Tests that hit DB are 
in their own file so that they don't slow down the other tests.

> I don't see how this would work if you're using the DB in any reasonably 
> sophisticated way, given that SQLite tends not to support such things.
What things does sqlite not support? joins?



Pick your poison whether it is rspec, test/unit, whatever, as long as 
you test, your choice is always a good one.
-- 
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