Ruby on Rails testing

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…

On Nov 30, 5:11 am, alex [email protected] 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

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.

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 B.
Freelancer
http://frozenplague.net

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs