Skip to content
Poignant Guide Ruby Q&A

Minitest or RSpec: which should a beginner learn first?

Needs an answerAsked by Lotte B. · Testing, style and clean code0 replies

Short answer

I automate tests for a living and my team uses RSpec, so that is what I know. A colleague from the Utrecht office has started learning Ruby from the Poignant Guide in the evenings and asked me which test framework she should learn first. I realised I could not give a neutral answer.

Written by Lotte B. ·
CitePoignant Guide Ruby Q&A, "Minitest or RSpec: which should a beginner learn first?", https://poignantguide.net/answers/read/minitest-or-rspec-which-should-a-beginner-learn-first/, accessed 2026-12-04.
  1. Member ·

    This is the same tiny check in both tools, which I ran on Ruby 3.3 to compare them:

    # add_test.rb (Minitest)
    require "minitest/autorun"
    
    def add(a, b) = a + b
    
    class AddTest < Minitest::Test
      def test_adds_two_numbers
        assert_equal 5, add(2, 3)
      end
    end
    
    # add_spec.rb (RSpec)
    def add(a, b) = a + b
    
    RSpec.describe "add" do
      it "adds two numbers" do
        expect(add(2, 3)).to eq(5)
      end
    end
    

    Minitest ran with ruby add_test.rb and printed 1 runs, 1 assertions, 0 failures, 0 errors, 0 skips. RSpec needed gem install rspec first, then rspec add_spec.rb printed 1 example, 0 failures.

    For a beginner, which one first? I do not want to give her my habit as if it were a fact. Does it matter for jobs, for Rails, or for learning the language itself?

    0
    ReplyLink

Plain text or simple Markdown. Links are nofollow. Your email is never shown.

No answers yetLotte B. is waiting. If you have seen this before, a two-line answer helps.
Write an answer
Poignant Guide Ruby Q&A. Questions and answers on learning Ruby and programming: syntax, blocks, objects, gems, Rails, debugging and reading the Poignant Guide.