Running Ruby Unit Tests

Use the Ruby Unit::Test framework to write and run unit tests on Ruby files in 3rdRail.

Ruby Unit Testing in Rails

Rails creates a default unit test for each model created. Find template Unit test files in the Rails Explorer: Project Folder| Tests| Unit Tests.

Open a unit test in the Ruby Editor and replace template data with test data.

The Fixtures file holds the fixtures template for the associated test: Project Folder| Tests| Fixtures.

Running Unit Tests in 3rdRail

To run unit tests on Ruby code:

  1. Right-click the project file in an Explorer or open the file in the Ruby Editor.
  2. Choose Run As| Ruby Script.

The test runs and results are displayed in the Console View .

Useful Resources

Here is more information about unit testing Ruby code:

Corporate LogoCodeGear brand and product names are service marks, trademarks or registered trademarks of Borland Software Corporation in the United States and other countries.