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