Chapter 7. Testing


You probably always write automated tests for all your software ... or feel guilty for skipping them. Dynamically typed languages such as Ruby don't have a compile step that can catch errors, as Java or C++ does. Well, you'll be happy to know that Ruby on Rails makes automated testing very easy. In Rails, testing is not something that was bolted on afterwards. Testing has been built in from the very beginning. Rails was designed to be testable and to produce applications that are testable. It is so easy to create automated tests for a Rails appli187cation that you should feel guilty if you don't!

We've come this far with our Photo Share web application, but we haven't yet created any tests. In truth, this was deliberate . You had enough new things to learn as it was. But now it is time to rectify that oversight and start adding tests to our application. So let's skip the guilt and code some tests.



Ruby on Rails[c] Up and Running
Ruby on Rails[c] Up and Running
ISBN: B003D3OGCY
EAN: N/A
Year: 2006
Pages: 94

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net