Leanpub Header

Skip to main content

Testing Rails from Scratch

Community discussions

An aside on ‘test’ (method vs block style)

Ben Sheldon8/17/2026
General

I wanted to note this statement is not true about using either test method or test block style:


> You may use either syntax in Rails


If your test class inherits from a Rails provided test class, you must use the block style, because built-in setup behavior relies on the block syntax plumbing and they may not run when using method style.

0 replies

Log in to join the discussion.