RubyMine 2017.3 Help

Running Tests


RubyMine makes it possible to run all tests in a container, individual tests or test methods. For each one, RubyMine provides a temporary run-debug configuration that can be saved if necessary as a permanent one.

Note also that the commands shown in the context menu, are context-sensitive, that is the testing command that shows depends on the test runner and the place where this command is invoked.

rm context dependent testing

There is a dedicated test Rake task. This task runs tests with the specified arguments and the test runner UI. You can create a custom run/debug configuration for a Rake task on the base of the existing test task.

To run this task, press Ctrl+Alt+R, and then press t. Refer to the section Running Rake Tasks for details.

Running all tests in a directory

To run all tests in a directory

  1. In the Project tool window, select the directory that contains tests to be executed.
  2. On the context menu, choose the corresponding run command.

    If the directory contains tests that belong to the different testing frameworks, select the configuration to be used.

    For example, choose Run 'All tests in: <directory name>'.

    ruby runAllTests
  3. Explore results in the test runner.

Running test cases or test scripts

To run a test case or test script

  1. Open the desired test in the editor, or select it in the Project tool window.
  2. On the context menu of the selection, choose Run <test class name>.

Running test methods or examples

To run a test method or example

  1. Open the desired test in the editor.
  2. Place the caret somewhere within the test method body.
  3. On the context menu, choose Run <test method name>.
Last modified: 10 March 2018

See Also