Menu Sidebar
Menu

rspec

RubyTapas Freebie: Gem Love Part 2

I have a few ongoing miniseries in RubyTapas. In this, the second installment of a miniseries chronicling the creation of a Rubygems plugin and an associated server, I touch on a number of topics including acceptance testing, the shellwords standard library, the TDD rhythm, and the DataMapper ORM.

Testing that a block is called

CapnKernul asks: Hey Avdi. How would you test that a method’s provided block is called in RSpec? Would you stub #to_proc (for &block) and mock #call? Typically the way I test that a block is called goes something like this:

That’s for the simple case of just checking if the block is called. When […]

Older Posts

Virtuous Code

"The three virtues of a programmer: laziness, impatience, and hubris" — Larry Wall

Books and Screencasts

RubyTapas Screencasts

RubyTapas Screencasts

Small plates of gourmet Ruby code.

Confident Ruby

Confident Ruby cover

32 Patterns for joyful coding.

The Making of Cowsays.com

Confident Ruby cover

Watch me build an app in Sinatra and Rails

Objects on Rails

Objects on Rails

A developer notebook on applying classic Object-Oriented principles to Ruby on Rails projects.

Exceptional Ruby

Exceptional Ruby

The definitive guide to exceptions and failure handling in Ruby.

Archives

Categories