< mockra >

Blocks in IRB - 23 Jul 2012


I’ve been using blocks to test a variety of different features in my Rails applications, and one thing that I’ve found incredibly helpful is adding nil to the end of a block. It’s a great way to suppress the block content you’re iterating through. Just add the following to your blocks:

@users.each do |user|
  puts user.test_content
end; nil