Guide
Choosing Between RSpec and Minitest Test Runners in RubyMine
Learn how to decide which test framework to run inside RubyMine, compare RSpec and Minitest options, and validate the configuration with a quick terminal check.
Published by Tasadduq Burney
12 Dec 2025, 06:33 UTC
3 min95.7K views0

Decision and Constraints
When you want to run tests directly from RubyMine’s UI instead of opening a terminal, you must pick a test framework that is already present in the project’s Gemfile and supported by the IDE’s built‑in runner. The decision is constrained by three factors:
- Gemfile dependencies – the framework gem (rspec-rails or minitest) must be listed under the :test group.
- RubyMine version – the bundled test runner requires RubyMine 2020.2 or newer; older releases lack full Minitest colour support.
- Feedback latency – you need instant visual results in the Run tool window without switching to an external shell.
Option Comparison
| Framework | Plugin required | Run configuration UI | Parallel execution | Default formatter |
|---|---|---|---|---|
| RSpec | Bundled (no extra plugin) | Run/Debug Configurations → + → RSpec | Yes – via the parallel_tests gem or built‑in rspec --parallel (requires gem) | Progress bar with colour |
| Minitest | Bundled (no extra plugin) | Run/Debug Configurations → + → Minitest | Limited – depends on minitest-parallel gem; native parallel support arrived in RubyMine 2021.3 | Simple output; colour only from 2021.3 onward |
Trade‑offs
- RSpec – expressive DSL, rich matcher library, built‑in support for parallel runs, but adds the
rspec-railsgem (and optionallyfactory_bot,capybara) which increases bundle size and startup time. - Minitest – ships with Ruby, minimal overhead, faster test suite boot, integrates naturally with Rails’ default test suite, yet lacks advanced mocking frameworks and the extensive formatter ecosystem that RSpec provides out of the box.
Configuration Steps
- Open the project’s
Gemfile(requires write permission). Add the appropriate gem under the:testgroup:
If you choose Minitest and want parallel execution, also add:group :test do gem 'rspec-rails', '~> 6.0' # for RSpec # gem 'minitest' # for Minitest (already in Ruby stdlib) endgem 'minitest-parallel', '~> 1.0' - Run
bundle installfrom the project root (or use RubyMine’sTools → Bundler → Install) to fetch the gems. - In RubyMine, open
Run → Edit Configurations…. Click the+button and select RSpec or Minitest according to the gem you added. - Fill in the fields:
- Name: a descriptive label, e.g.
Model Specs. - Working directory:
$PROJECT_DIR$(or an explicit path placeholder). - Test scope: choose
Directoryand point tospec(RSpec) ortest(Minitest). - Ruby SDK: ensure the selector matches the SDK used by Bundler (usually
Rubyfromrbenvorrvm). - Environment variables: optionally set
RAILS_ENV=testif not already default.
- Name: a descriptive label, e.g.
- Click
OKto save the configuration. - Select the new configuration from the toolbar dropdown and press
Shift+F10(or click the run icon). The Run tool window appears showing the test progress.
Validation
- After the run finishes, inspect the Run tool window:
- The toolbar should display the RSpec or Minitest icon.
- The summary line reads something like
3 examples, 0 failures(RSpec) or3 tests, 0 assertions, 0 failures(Minitest). - Clicking a stack‑trace line opens the corresponding source file at the exact line number.
- The displayed duration should be comparable to the time reported when you run the same suite from a terminal.
- Open a terminal (
Alt+F12in RubyMine) and execute the suite with Bundler:# RSpec bundle exec rspec spec # Minitest bundle exec rake test # or: bundle exec ruby -Ilib:test test/**/*_test.rb - Compare the exit code (
echo $?should be 0 for success) and the total time. If the numbers match within a few seconds, the RubyMine configuration is correct. - If you see load‑path errors or missing gem messages, verify that the Ruby SDK selected in the run configuration matches the one used by
which rubyin the terminal.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.