# Run/debug configurations for tests

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/ruby/2026.3/llms.txt).

When you run tests [for the first time](performing-tests.html), RubyMine automatically creates a corresponding RSpec or Test::Unit/Shoulda/MiniTest [temporary configuration](run-debug-configuration.html#temp_config), which can be saved. If necessary, you can create the required test run/debug configuration [manually](#create_test_config) from the predefined template.

## Create a test configuration

Procedure: Create a test configuration from the Project view

1. In the Project view `Alt+1` (Windows), `⌘ 1` (macOS), `⌘ 1` (IntelliJ IDEA Classic (macOS)), `⌘ 1` (macOS System Shortcuts), `Alt+1` (XWin), `Alt+1` (GNOME), `Alt+1` (KDE), `Alt+1` (Emacs), `Alt+1` (Sublime Text), `⌘ 1` (Sublime Text (macOS)), `Ctrl+Alt+L` (Visual Studio), `⌘ ⌥ L` (Visual Studio (macOS)), `Meta+1` (TextMate), `Ctrl+1` (NetBeans), `Alt+1` (Eclipse), `Alt+1` (Eclipse (macOS)), right-click a specific test file or a directory containing the required tests, for example, `test`, `spec`, or `features`.

2. From the context menu, select `More Run/Debug | Modify Run Configuration` or `Run 'All tests in: <directory name>'` depending on the used [testing framework](testing-frameworks.html#supported_frameworks).

![Create a test run configuration](https://resources.jetbrains.com/help/img/idea/2026.3/rm_test_run_config_create.png)

3. In the dialog that opens, specify the run/debug configuration parameters ([RSpec](#rspec) or [Minitest](#minitest)), apply changes and close the dialog.

Procedure: Create a test configuration from the editor

1. Open the test file in the editor and do one of the following:

* Click the Run button on the gutter next to the required test or test class. ![Run a specific test](https://resources.jetbrains.com/help/img/idea/2026.3/rm_get_started_tests_run_specific.png)

* Place the caret at the required test or test class name and press `Alt+Enter` (Windows), `⌥ ⏎` (macOS), `⌥ ⏎` (IntelliJ IDEA Classic (macOS)), `⌥ ⏎` (macOS System Shortcuts), `Alt+Enter` (XWin), `Alt+Enter` (GNOME), `Alt+Enter` (KDE), `Alt+Enter` (Emacs), `Alt+Enter` (Sublime Text), `⌥ ⏎` (Sublime Text (macOS)), `Alt+Enter` (Visual Studio), `⌥ ⏎` (Visual Studio (macOS)), `Alt+Enter` (TextMate), `Alt+Enter` (NetBeans), `Ctrl+1` (Eclipse), `⌘ 1` (Eclipse (macOS)).

2. Select Modify Run Configuration.

3. In the dialog that opens, specify the run/debug configuration parameters ([RSpec](#rspec) or [Minitest](#minitest)), apply changes and close the dialog.

## Run/debug configuration: RSpec

Configure a [newly created](#create_test_config) or existing RSpec run configuration on the Configuration tab:

| Item | Description |
| --- | --- |
| Name | Specify the name of the current run/debug configuration. |
| Mode | Define the scope of tests to run:       * All specs in a folder: Select this option to run all tests in a particular directory.    * Spec script: Select this option to run a specific test.    * Multiple specs: Select this option to run tests from multiple spec files.    |
| Specs folder | Specify the fully qualified path to the directory that contains the desired specs. Alternatively, click ![the Browse button](https://resources.jetbrains.com/help/img/idea/2026.3/*_spec.rb`.     This field is only available, when the All specs in folder option is selected.    |
| Spec script | Specify the name of the script to be executed.     This field is only available, when the Spec script option is selected.    |
| Specs | Specify the names of the desired specs. Alternatively, click ![the Browse button](https://resources.jetbrains.com/help/img/idea/2026.3/app.general.ellipsis.svg) and select the specs in the dialog that opens.     This field is only available, when the Multiple specs option is selected.    |
| Example names | Specify one or several names of the examples within the script to be executed. Use `\|\|` to separate example names.     If no example is specified, all examples will be executed.     This field is only available, if either the Spec script or Multiple specs option is selected.    |
| Example IDs/line number |    Specify the [Unique ID](https://rspec.info/documentation/3.9/rspec-core/RSpec/Core/Example.html#id-instance_method) of an example or example group to run or, alternatively, specify the line number with the desired example or example group.     An example ID consists of a combination of the example number and the numbers of example groups that contain it, separated by colons. For instance, if you have a test file with three example groups, the second group contains three examples, and you want to run the first example, its example ID will be `[2:1]`.     Use square brackets when specifying example IDs and separate multiple IDs with commas, such as `[1:2:1],[2:3]`. To run all examples of a particular group at once, specify the example group number in square brackets, for instance, `[2]`.     To run an example or example group using its line number, specify it without using square brackets.     > **Note:** > RubyMine does not update line numbers or IDs used in the run/debug configuration automatically. Make sure to update the necessary settings manually when you change your file.    |
| Runner options | Provide additional options to customize RSpec's behavior. Learn more about the available options from [Command line](https://rspec.info/features/3-12/rspec-core/command-line/). |
| 'rspec' gem | Use this list to select the required gem version, which will be used to run the tests. The list shows the versions that are available in the Ruby interpreter. By default, the latest available version is taken.  |
| Use custom RSpec runner script | Select this checkbox if you want to use an alternative spec runner. You can type the fully qualified path to the spec runner in the text field, or click ![the Browse button](https://resources.jetbrains.com/help/img/idea/2026.3/app.general.ellipsis.svg), and select the desired runner in the [dialog that opens](select-path-dialog.html)  .  |
|  Use pre-load server  |     From the list, select the server to be used for executing scripts or examples.       Select None if you want to execute a script or example locally, without any server.      |
| Output full backtrace | Select this checkbox to enable the `--trace` option.  |
| Working directory | Specify the working directory used by the running task. For example, this option is in effect when the running script loads other scripts by relative paths.  |
| Environment variables |    Specify the list of environment variables as the name-value pairs, separated with semi-colons. Alternatively, click ![the Browse button](https://resources.jetbrains.com/help/img/idea/2026.3/app.general.ellipsis.svg) to create variables and specify their values in the Environment Variables dialog.       |
| Ruby arguments |    Specify the [command-line arguments](https://ruby-doc.com/docs/ProgrammingRuby/html/rubyworld.html) to be passed to the Ruby interpreter.                 |
| Ruby interpreter | Specify the desired Ruby interpreter. You can choose the project default Ruby interpreter, or select a different one from the list of configured Ruby interpreters.  |

## Run/debug configuration: Test::Unit/Shoulda/MiniTest

Configure a [newly created](#create_test_config) or existing Test::Unit/Shoulda/MiniTest run configuration on the Configuration tab:

| Item | Description |
| --- | --- |
| Name | Specify the name of the current run/debug configuration. |
| Mode |    Define the scope of tests to run:       * All tests in folder: Select this option to run all tests in a particular directory.    * Test scripts: Select this option to run tests from one or several specified test files.    * Test method: Select this option to run an individual method of a test class.    |
| Test folder | Specify the fully qualified path to the directory that contains the desired tests. Alternatively, click ![the Browse button](https://resources.jetbrains.com/help/img/idea/2026.3/app.general.ellipsis.svg) and select the test directory in the dialog that opens.     This field is only available, when the All tests in folder option is selected.    |
| Test file name mask | Specify the mask for a test filename, for example: `**/{*_test,test_*}.rb`.     This field is only available, when the All tests in folder option is selected.    |
| Ruby scripts | Specify one or multiple fully qualified paths to the desired tests. Alternatively, click ![the Browse button](https://resources.jetbrains.com/help/img/idea/2026.3/app.general.ellipsis.svg) and select one or multiple test files in the  dialog that opens .     This field is only available, when the Test scripts option is selected.    |
| Ruby script | Specify the fully qualified path to the test that contains the method you want to run. Alternatively, click ![the Browse button](https://resources.jetbrains.com/help/img/idea/2026.3/app.general.ellipsis.svg) and select the test file in the  dialog that opens .     This field is only available, when the Test method option is selected.    |
| Test name filter | Type a filtering expression or the name of a test method. The test name filter can be a regular expression.     This field is only available, when the Test method option is selected.    |
|  Use pre-load server  |     From the list, select the server to be used for executing scripts or examples.       Select None if you want to execute a script or example locally, without any server.      |
| Runner options | Specify the options to be passed to the test runner. Learn more about the available MiniTest runner options from [Running Your Tests](https://docs.seattlerb.org/minitest/#label-Running+Your+Tests).  |
| Working directory | Specify the working directory used by the running task. For example, this option is in effect when the running script loads other scripts by relative paths.  |
| Environment variables |    Specify the list of environment variables as the name-value pairs, separated with semi-colons. Alternatively, click ![the Browse button](https://resources.jetbrains.com/help/img/idea/2026.3/app.general.ellipsis.svg) to create variables and specify their values in the Environment Variables dialog.       |
| Ruby arguments |    Specify the [command-line arguments](https://ruby-doc.com/docs/ProgrammingRuby/html/rubyworld.html) to be passed to the Ruby interpreter.                 |
| Ruby interpreter | Specify the desired Ruby interpreter. You can choose the project default Ruby interpreter, or select a different one from the list of configured Ruby interpreters.  |

## Run tests using a predefined configuration

To run the test(s) using the already created run/debug configuration, do one of the following:

Procedure:

* Press `Ctrl` (Windows), `Ctrl` (macOS), `Ctrl` (IntelliJ IDEA Classic (macOS)), `Ctrl` (macOS System Shortcuts), `Ctrl` (XWin), `Ctrl` (GNOME), `Ctrl` (KDE), `Ctrl` (Emacs), `Ctrl` (Sublime Text), `Ctrl` (Sublime Text (macOS)), `Ctrl` (Visual Studio), `Ctrl` (Visual Studio (macOS)), `Ctrl` (TextMate), `Ctrl` (NetBeans), `Ctrl` (Eclipse), `Ctrl` (Eclipse (macOS)) twice to invoke the Run Anything popup. Start typing the required configuration name, select it from the list, and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (TextMate), `Enter` (NetBeans), `Enter` (Eclipse), `⏎` (Eclipse (macOS)).

* Select the desired configuration on the toolbar and click ![Run](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.execute.svg) `Shift+F10` (Windows), `⌃ R` (macOS), `⇧ F10` (IntelliJ IDEA Classic (macOS)), `⌥ ⇧ R` (macOS System Shortcuts), `Shift+F10` (XWin), `Shift+F10` (GNOME), `Shift+F10` (KDE), `Shift+F10` (Emacs), `Shift+F10` (Sublime Text), `Shift+F10` (Sublime Text (macOS)), `Ctrl+F5` (Visual Studio), `⌃ F5` (Visual Studio (macOS)), `Meta+Ctrl+R` (TextMate), `F6` (NetBeans), `Alt+Shift+X` (Eclipse), `⌘ ⇧ F11` (Eclipse (macOS)).

* Go to `Run | Run...` `Alt+Shift+F10` (Windows), `⌃ ⌥ R` (macOS), `⌥ ⇧ F10` (IntelliJ IDEA Classic (macOS)), `⌃ ⌥ R` (macOS System Shortcuts), `Alt+Shift+F10` (XWin), `Alt+Shift+F10` (GNOME), `Alt+Shift+F10` (KDE), `Alt+Shift+F10` (Emacs), `Alt+Shift+F10` (Sublime Text), `⌃ ⌥ R` (Sublime Text (macOS)), `Ctrl+Alt+Shift+R` (Visual Studio), `⌘ ⌥ ⇧ R` (Visual Studio (macOS)), `Meta+R` (TextMate), `Alt+Shift+F10` (NetBeans), `Alt+Shift+F10` (Eclipse), `⌃ ⌥ R` (Eclipse (macOS)) and select the desired configuration from the list and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (TextMate), `Enter` (NetBeans), `Enter` (Eclipse), `⏎` (Eclipse (macOS)).

> **Tip:**
> You can also use the [Services tool window](services-tool-window.html#run-configs) to manage multiple run/debug configurations at once in a dedicated tool window.

## See also

