Ruby on Rails 2.1 Unit Testing

Hi,

Just introduced few more chapters in my Ruby on Rails 2.1 tutorial. Most
interesting one is Unit Testing of RoR Applications.

Just go through it and send me your comments.

Thanks.

Mc Mohd wrote:

Just introduced few more chapters in my Ruby on Rails 2.1 tutorial. Most
interesting one is Unit Testing of RoR Applications.

Just go through it and send me your comments.

Ruby on Rails 2.1 - Unit Testing

Tx! Now your verbiage has repeated a common misunderstanding.

test case: one ‘def test_*’ method that runs one event of testage
test suite: a list of test cases with common setup & fixtures

the misunderstanding arises when a test suite inherits TestCase. This
just means
it follows the Interpreter Design - Suite 1–>* Suite 1–>* Case. The
test
runner instantiates the whole suite once for each time it runs one case.
That
helps Test Isolation…

Now test…

  • some Views!
  • some controllers from a misnamed suite. You need:

class WhateverTest < ActiveController::TestCase
tests MyController