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.
In many cases, you can initiate a testing session from a context menu. For this purpose, the Run and Debug commands are provided in certain context menus. For example, these commands are available for a test class, directory, or a package in the Project Tool Window. They are also available for a test class or method you are currently working on in the editor.
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 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 tests using Rake
To run tests using Rake, do one the following:
Press Ctrl twice. In the invoked popup, start typing the name of a Rake task that runs tests (for example,
rake spec:controllers). Select the required task and press Enter.
From the main menu, select(Ctrl+Alt+R). In the invoked popup, start typing the name of a Rake task that runs tests (for example,
spec:controllers). Select the required task and press Enter.
Run tests from the Project view
To run 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, select the corresponding run command.
If the directory contains tests that belong to the different testing frameworks, select the configuration to be used. For example, select .
Run tests from the editor
To run tests from the editor, perform the following steps:
Click the Run button on the left gutter next to the required test or test class.
From the context menu, select the required run command.
RubyMine will run and display test results in the Run tool window.
If some tests are failed, you can rerun them.