yield matcher

# wanna test the yielded results
describe "#method_with_yield" do
  it do
    yielded = []
    subject.method_with_yield { |x, y| yielded << [x, y] }
    expect(yielded.count).to eq 3
  end
end
# just test if method yielded 
specify { expect { |b| subject.method_with_yield(&b) }.to yield_control }

Reference

results matching ""

    No results matching ""