# Run tests

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

> **TL;DR**
> Run the selected test or test folder: `Ctrl+Shift+F10` (Windows), `⌃ ⇧ R` (macOS), `⌃ ⇧ F10` (IntelliJ IDEA Classic (macOS)), `⌃ ⇧ R` (macOS System Shortcuts), `Ctrl+Shift+F10` (XWin), `Ctrl+Shift+F10` (GNOME), `Ctrl+Shift+F10` (KDE), `Ctrl+Shift+F10` (Emacs), `Ctrl+Shift+F10` (Sublime Text), `Ctrl+Shift+F10` (Sublime Text (macOS)), `Ctrl+Alt+F5` (Visual Studio), `⌃ ⌥ F5` (Visual Studio (macOS)), `Meta+Shift+R` (TextMate), `Alt+Shift+F6` (NetBeans), `Ctrl+Shift+F10` (Eclipse), `⌃ ⇧ R` (Eclipse (macOS))
>
>
>
> Stop the current test session: `Ctrl+F2` (Windows), `⌘ F2` (macOS), `⌘ F2` (IntelliJ IDEA Classic (macOS)), `⌃ ⇧ .` (macOS System Shortcuts), `Ctrl+F2` (XWin), `Ctrl+F2` (GNOME), `Ctrl+2` (KDE), `Ctrl+F2` (Emacs), `Ctrl+F2` (Sublime Text), `Ctrl+F2` (Sublime Text (macOS)), `Shift+F5` (Visual Studio), `⇧ F5` (Visual Studio (macOS)), `Ctrl+\` (TextMate), `Shift+F5` (NetBeans), `Ctrl+F2` (Eclipse), `⌘ F2` (Eclipse (macOS))

Procedure: Run tests directly in a file or folder

If your tests do not require any specific actions before start, and you do not want to configure additional options,  such as [code coverage](code-coverage.html) ,  you can run them by using the following options:

* Place the caret at the test class to run all tests in that class, or at the test method, and press `Ctrl+Shift+F10` (Windows), `⌃ ⇧ R` (macOS), `⌃ ⇧ F10` (IntelliJ IDEA Classic (macOS)), `⌃ ⇧ R` (macOS System Shortcuts), `Ctrl+Shift+F10` (XWin), `Ctrl+Shift+F10` (GNOME), `Ctrl+Shift+F10` (KDE), `Ctrl+Shift+F10` (Emacs), `Ctrl+Shift+F10` (Sublime Text), `Ctrl+Shift+F10` (Sublime Text (macOS)), `Ctrl+Alt+F5` (Visual Studio), `⌃ ⌥ F5` (Visual Studio (macOS)), `Meta+Shift+R` (TextMate), `Alt+Shift+F6` (NetBeans), `Ctrl+Shift+F10` (Eclipse), `⌃ ⇧ R` (Eclipse (macOS)). Alternatively, click the ![](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.run.run.svg) gutter icon next to the test class or test method and select Run '<test name>' from the list.

The gutter icon changes depending on the state of your test:

* The ![](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.actions.runAll.svg) gutter icon marks a set of tests.

* The ![](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.run.run.svg) gutter icon marks new tests.

* The ![](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.gutter.runSuccess.svg) gutter icon marks successful tests.

* The ![](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.gutter.runError.svg) gutter icon marks failed tests.

![Run a specific test from the editor](https://resources.jetbrains.com/help/img/idea/2026.3/rm_get_started_tests_run_specific.png)

* You can run all tests in one or several files or a folder at once. Select the required folder or test files and press `Ctrl+Shift+F10` (Windows), `⌃ ⇧ R` (macOS), `⌃ ⇧ F10` (IntelliJ IDEA Classic (macOS)), `⌃ ⇧ R` (macOS System Shortcuts), `Ctrl+Shift+F10` (XWin), `Ctrl+Shift+F10` (GNOME), `Ctrl+Shift+F10` (KDE), `Ctrl+Shift+F10` (Emacs), `Ctrl+Shift+F10` (Sublime Text), `Ctrl+Shift+F10` (Sublime Text (macOS)), `Ctrl+Alt+F5` (Visual Studio), `⌃ ⌥ F5` (Visual Studio (macOS)), `Meta+Shift+R` (TextMate), `Alt+Shift+F6` (NetBeans), `Ctrl+Shift+F10` (Eclipse), `⌃ ⇧ R` (Eclipse (macOS)). Alternatively, call the context menu and select `Run 'All tests in <directory name>'` or `Run 'All specs in <directory name>'` depending on the [testing framework](testing-frameworks.html#supported_frameworks) in use.

![Run all tests in a directory](https://resources.jetbrains.com/help/img/idea/2026.3/ruby_runAllTests.png)

Procedure: Run tests using the Run widget

When you run a test, RubyMine creates a temporary [run configuration](creating-run-debug-configuration-for-tests.html). You can save temporary run configurations, change their settings(for example, pass task arguments, specify environment variables, and so on), share them with other members of your team.

1. Create a new [run configuration](run-debug-configuration.html) or save a temporary one.

2. Use the Run widget on the main toolbar to select the configuration you want to run.

3. Click ![](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.run.run.svg) or press `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)).

![Running a run/debug configuration for tests](https://resources.jetbrains.com/help/img/idea/2026.3/rm_run_config_tests.png)

Procedure: Run tests from Structure

* In the Structure tool window, right-click a test and select ![](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.gutter.run.svg) Run 'method name' (`Ctrl+Shift+F10` (Windows), `⌃ ⇧ R` (macOS), `⌃ ⇧ F10` (IntelliJ IDEA Classic (macOS)), `⌃ ⇧ R` (macOS System Shortcuts), `Ctrl+Shift+F10` (XWin), `Ctrl+Shift+F10` (GNOME), `Ctrl+Shift+F10` (KDE), `Ctrl+Shift+F10` (Emacs), `Ctrl+Shift+F10` (Sublime Text), `Ctrl+Shift+F10` (Sublime Text (macOS)), `Ctrl+Alt+F5` (Visual Studio), `⌃ ⌥ F5` (Visual Studio (macOS)), `Meta+Shift+R` (TextMate), `Alt+Shift+F6` (NetBeans), `Ctrl+Shift+F10` (Eclipse), `⌃ ⇧ R` (Eclipse (macOS))).

![Run code from the tool window](https://resources.jetbrains.com/help/img/idea/2026.3/rm_run_tests_from_structure.png)

RubyMine creates a temporary run configuration with this test. To re-use theis configuration, [save it](run-debug-configuration.html#save-as-permanent) and edit, if necessary.

Procedure: Run tests from the Commit tool window

If you made changes to your test classes and want to run them before committing, you can do it from the [Commit](commit-and-push-changes.html#commit) tool window. You can choose whether to run a single test class, multiple classes, or all uncommitted test classes under a directory, module, or changelist.

1. Go to the Commit tool window (`Alt+0` (Windows), `⌘ 0` (macOS), `⌘ 0` (IntelliJ IDEA Classic (macOS)), `⌘ 0` (macOS System Shortcuts), `Alt+0` (XWin), `Alt+0` (GNOME), `Alt+0` (KDE), `Alt+0` (Emacs), `Alt+0` (Sublime Text), `⌘ 0` (Sublime Text (macOS)), `Alt+0` (Visual Studio), `Alt+0` (Visual Studio (macOS)), `Meta+0` (TextMate), `Alt+0` (NetBeans), `Alt+0` (Eclipse), `⌘ 0` (Eclipse (macOS))).

2. Right-click a test class, directory, module, or changelist, and select ![Run icon](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.run.run.svg) Run '<Test Class Name>'.

> **Tip:**
> To select multiple items, hold `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)) while clicking each item.

![Run action in the context menu of the Commit tool window](https://resources.jetbrains.com/help/img/idea/2026.3/run-test-from-commit-tw.png)

As a result, RubyMine creates and launches a temporary run configuration for your test selection. If you want to rerun the same tests in the future, you can [save this
configuration](run-debug-configuration.html#save-as-permanent) in the run widget and then [customize
its settings](null).

> **Tip:**
> To preserve the tab of a run configuration, even if you execute another run configuration, [you may pin it](run-tool-window.html#pin_tabs).

After RubyMine finishes running your tests, it shows the results in the Run tool window on the tab for that run configuration. For more information about analyzing test results, refer to [Explore test results](viewing-and-exploring-test-results.html).

## Run tests using Rake tasks

To run tests using a [Rake task](rake.html), do the following:

Procedure:

1. Go to `Tools | Run Rake Task`.

2. In the invoked popup, start typing the name of a Rake task that runs tests, for example, `rake test` or `rake spec:controllers`.

3. Select the desired Rake task 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:**
> RubyMine automatically creates the Rake run configurations for running the Minitest and RSpec tests in Rails applications - test and spec. Learn how to run code using configurations from [Run tests using a predefined configuration](creating-run-debug-configuration-for-tests.html#run_config).

## Run tests after commit

When you want to check that your changes would not break the code before pushing them, you can do that by running tests as commit checks.

> **Note:**
> This feature is only available for [Git](using-git-integration.html) and [Mercurial](using-mercurial-integration.html).

Procedure: Set up test configuration

1. Press `Alt+0` (Windows), `⌘ 0` (macOS), `⌘ 0` (IntelliJ IDEA Classic (macOS)), `⌘ 0` (macOS System Shortcuts), `Alt+0` (XWin), `Alt+0` (GNOME), `Alt+0` (KDE), `Alt+0` (Emacs), `Alt+0` (Sublime Text), `⌘ 0` (Sublime Text (macOS)), `Alt+0` (Visual Studio), `Alt+0` (Visual Studio (macOS)), `Meta+0` (TextMate), `Alt+0` (NetBeans), `Alt+0` (Eclipse), `⌘ 0` (Eclipse (macOS)) to open the Commit tool window and click Show Commit Options ![the Settings button](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.settings.svg).

2. Under the Advanced Commit Checks menu, next to the Run Configuration option, click  Choose configuration  and select which configuration  you want to run.

![Pre-commit checks menu](https://resources.jetbrains.com/help/img/idea/2026.3/run-tests-before-commit-0.png)

After you have set up the test configuration, the specified tests will run every time you make a commit.

## Stop tests

Procedure:

Use the following options on the Run toolbar of the tab for the run configuration:

* Click ![the Stop button](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.run.stop.svg) or press `Ctrl+F2` (Windows), `⌘ F2` (macOS), `⌘ F2` (IntelliJ IDEA Classic (macOS)), `⌃ ⇧ .` (macOS System Shortcuts), `Ctrl+F2` (XWin), `Ctrl+F2` (GNOME), `Ctrl+2` (KDE), `Ctrl+F2` (Emacs), `Ctrl+F2` (Sublime Text), `Ctrl+F2` (Sublime Text (macOS)), `Shift+F5` (Visual Studio), `⇧ F5` (Visual Studio (macOS)), `Ctrl+\` (TextMate), `Shift+F5` (NetBeans), `Ctrl+F2` (Eclipse), `⌘ F2` (Eclipse (macOS)) to terminate the process immediately.

![Stop running tests](https://resources.jetbrains.com/help/img/idea/2026.3/rm_stop_running_tests.png)

## Rerun tests

Procedure: Rerun a single test

* Right-click a test on the tab for the run configuration in the Run tool window and select Run 'test name'.

Procedure: Rerun all tests in a session

* Click ![the Rerun button](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.run.rerun.svg) on the Run toolbar or press `Ctrl+F5` (Windows), `⌘ R` (macOS), `⌃ F5` (IntelliJ IDEA Classic (macOS)), `⌘ R` (macOS System Shortcuts), `Ctrl+F5` (XWin), `Ctrl+F5` (GNOME), `Ctrl+5` (KDE), `Ctrl+F5` (Emacs), `Ctrl+F5` (Sublime Text), `⌘ R` (Sublime Text (macOS)), `Ctrl+Alt+R` (Visual Studio), `⌘ ⌥ R` (Visual Studio (macOS)), `Ctrl+Alt+R` (TextMate), `Ctrl+F5` (NetBeans), `Ctrl+F5` (Eclipse), `Ctrl+F5` (Eclipse (macOS)) to rerun all tests in a session.

Procedure: Rerun failed tests

You can rerun and debug  tests that failed in your last test run without having to rerun the tests that passed.

* To rerun failed tests, go to the Run tool window's toolbar and click ![Rerun Failed Tests icon](https://resources.jetbrains.com/help/img/idea/2026.3/intellij.platform.ide.expui.run.restartFailedTests.svg) Rerun Failed Tests.

![Rerun failed tests](https://resources.jetbrains.com/help/img/idea/2026.3/rm_rerun_failed_tests.png)

* Hold `Shift` (Windows), `Shift` (macOS), `Shift` (IntelliJ IDEA Classic (macOS)), `Shift` (macOS System Shortcuts), `Shift` (XWin), `Shift` (GNOME), `Shift` (KDE), `Shift` (Emacs), `Shift` (Sublime Text), `Shift` (Sublime Text (macOS)), `Shift` (Visual Studio), `Shift` (Visual Studio (macOS)), `Shift` (TextMate), `Shift` (NetBeans), `Shift` (Eclipse), `Shift` (Eclipse (macOS)) and click ![](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.run.restartFailedTests.svg) to choose whether you want to Run the failed tests again or Debug  them.

![Rerun failed tests](https://resources.jetbrains.com/help/img/idea/2026.3/rm_rerun_failed_tests_debug.png)

Procedure: Rerun tests automatically

In RubyMine, you can enable the autotest-like runner: any test in the current run configuration restarts automatically after you change the related source code.

* Click ![](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.actions.rerunAutomatically.svg) Rerun Automatically on the test results toolbar to enable the autotest-like runner.

![The Rerun Automatically option](https://resources.jetbrains.com/help/img/idea/2026.3/rm_rerun_test_automatically.png)

## Debug failed tests

If you do not know why a test fails, you can debug it.

Procedure:

1. In the editor, click the gutter on the line where you want to set a   breakpoint .

There are different types of breakpoints that you can use depending on where you want to suspend the program. For more information, refer to [Breakpoints](using-breakpoints.html).

2. Right-click the ![](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.gutter.runError.svg) gutter icon next to the failed test and select Debug 'test name'.

![Debugging a failed test](https://resources.jetbrains.com/help/img/idea/2026.3/rm_debug_failed_test_gutter.png)

The test will rerun in debug mode. After that, the test will be suspended, allowing you to [examine its current state](examining-suspended-program.html).

You can [step through the test](stepping-through-the-program.html) to analyze its execution in detail.

## See also

### Reference

[Run tool window](run-tool-window.html)

