Forum: Ruby on Rails Ruby on Rails testing

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5f5bc8b6efa445d637f771b68d607ff6?d=identicon&s=25 alex (Guest)
on 2008-11-30 10:25
(Received via mailing list)
What is the upside to testing in Ruby on Rails? I'm learning Rails and
it seems like it's a waste of time to write code for something you
could test yourself...
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2008-11-30 10:28
(Received via mailing list)
On Nov 30, 5:11 am, alex <geshwi...@gmail.com> wrote:
> What is the upside to testing in Ruby on Rails? I'm learning Rails and
> it seems like it's a waste of time to write code for something you
> could test yourself...

Will you automatically repeat all of your tests everytime you change
the slightest bit of code?
In my opinion automated unit tests are one of the most invaluable
safeguards you can have.

Fred
90e140f8553ecdec1b0d7dbf608a0561?d=identicon&s=25 Pau Cor (phylae)
on 2008-11-30 12:01
alex wrote:
> What is the upside to testing in Ruby on Rails? I'm learning Rails and
> it seems like it's a waste of time to write code for something you
> could test yourself...

I can test all the important parts of my app in 21 seconds. That's less
time that it usually takes me to test just one thing by hand. If I had
to test all these features myself every time I made a change that
*might* break something (which is pretty much every change), then I'd be
spending 90% of my time clicking around in a web browser. Instead I
spend just half my time in a test directory.
9a2a53db8e9b4476038c94a64b32833f?d=identicon&s=25 Ryan Bigg (ryan-bigg)
on 2008-11-30 12:23
(Received via mailing list)
Write tests, write code.


Later:

Write code, break tests.

This is the part that saves your ass because if you're deploying
WITHOUT tests you're probably thinking "MY APP IS BULLETPROOF" when
actually it's "BULLET RIDDEN". So, if you have tests you'll see that
something is FUBAR'd and you'll really want to fix that before
deploying, therefore making you feel great that you're doing a little
work to keep the world safe and your clients happy that their
application is not broken.

-----
Ryan Bigg
Freelancer
http://frozenplague.net
This topic is locked and can not be replied to.