Leanpub Header

Skip to main content

Testing Rails from Scratch

Community discussions

Assertion argument ordering; expected, actual

Ben Sheldon8/17/2026
General

I think you’re using the opposite ordering of assertion arguments to Rails. Apologies if you mention this and I overlooked it.


https://guides.rubyonrails.org/testing.html#minitest-assertions


Eg. according to Rails docs, an example should be assert_equal(2, 1+1)


As I understand, junit style libraries are very inconsistent on this, but I wanted to note Rails convention.

0 replies

Log in to join the discussion.