Run and debug tests
Generally, RubyMine runs and debugs tests in the same way as other applications, by running the run/debug configurations you have created. When doing so, it passes the specified test classes or methods to the test runner.
If you run a test for which there is no permanent run/debug configuration, a temporary configuration is created. You can then save such a configuration using the Run/debug configuration dialog if you want to reuse it later.
The tests run in the background, so you can execute several tests at the same time.
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.
Run or debug tests using a predefined configuration
To run/debug the test(s) using the already created run configuration, do one of the following:
Press Ctrl twice. In the invoked popup, start typing a name of the configuration, select it from the list and press Enter. To debug the selected configuration, hold down the Shift key when running tests.
Press Shift+Alt+F10, select the required configuration and press Enter. For debugging, use the Shift+Alt+F9 shortcut.
To run tests from the main toolbar:
Select the required run/debug configuration from the list on the main toolbar.
Click Run Shift+F10 or Debug Shift+F9 on the right.
Run or debug tests using Rake tasks
To run or debug tests using a Run Rake tasks task, perform the following steps:
From the main menu, selectCtrl+Alt+R.
In the invoked popup, start typing the name of a Rake task that runs tests, for example,
Depending on whether you want to run or debug tests, select the desired Rake task from the list and do one of the following:
Hold down the Shift key (the dialog title will be changed to Debug) and pressEnter.
Run or debug tests from the Project view
To run or debug a test or multiple tests from the Project view, do the following:
Right-click a specific test file or a directory containing the required tests, for example, test, spec, or features.
From the context menu, selector .
From the submenu, select a command corresponding to the used testing framework. For example, this will be for Minitest or for RSpec.
Run or debug tests from the editor
To run tests from the editor, perform the following steps:
In the test file, do one of the following:
Click the Run button on the gutter next to the required test or test class.
Place the caret at the required test or test class name and press Alt+Enter.
Depending on whether you want to run or debug tests, selector . Press Enter.
RubyMine will run and display test results in the Run tool window.
If some tests are failed, you can rerun them.