It seems that rspec doesn’t support passing a block to a stub method.
This code fails:
describe “call_build_with_block” do
it “should call build with block” do
o = double(“object”)
o.should_receive(:build) do |&b|
block_given?.should == true