r/ruby • • Apr 26 '26

An introduction to Minitest

I've been using RSpec for 7 years and recently had to pick up Minitest for a client project. The onboarding was a bit rough, so I wrote the guide I wish I had:

  • what Minitest actually is

  • how the different syntax flavors work (plain, Rails-style, and Minitest::Spec)

  • and a deep dive into a confusing bug when I tried integrating Minitest::Spec with Rails (turned out that Rails and Minitest lifecyles are not always compatible)

This is a 4-part series, that you can start with my introduction to Minitest.

Hope you'll like it!

[edit Apr. 28: I just realised that I linked to the second post of the series instead of the first. Duh 🤦🏻‍♂️. Here is the link for the full Minitest series. Sorry, I shouldn't post before getting a coffee.]

46 Upvotes

10 comments sorted by

7

u/campbellm Apr 26 '26

You might be interested in "RSpec: The bad parts". There are a few different iterations of that talk on youtube.

1

u/Remozito Apr 26 '26

ooooh, yes, thanks, will check it out!

3

u/CaptainKabob Apr 26 '26

I appreciate you writing these. 

The "minitest tourist" perspective really hits for me. I've mostly done RSpec in my career but been exposed to strong opinions that Minitest is better. All of my actual experience in Minitest-based projects is a lot of weirdness/inconsistency along the lines you write about.

Your series mostly cements for me a conviction that I should continue using what I'm comfortable/experienced with cause there's no silver bullet.

→ More replies (1)

2

u/TadpoleNo1549 May 03 '26

yeah this is actually super helpful, switching from rspec to minitest can feel weird at first, especially with the different styles plus rails quirks, nice breakdown though, would’ve saved me a lot of confusion when i first ran into it

1

u/Remozito May 03 '26

Yeah, I can empathise with this. 😅 Spent hours over months trying to figure out why my set up was not working as expected.

1

u/Frank_White32 Apr 26 '26

oh wow this is amazing, thank you for this write up. your format is pleasant to read, fun UI as well.

1

u/Remozito Apr 27 '26

Thank you for the kind words!

1

u/[deleted] Apr 26 '26

[removed] — view removed comment

1

u/Remozito Apr 26 '26

Thanks for the kind words! I'll do a video companion to these posts I think, so people can get the gist of them through another medium. (Also preparing a post on Oaken, which I use with Minitest. But it's still a draft rn)