jookyboi
3/30/2013 - 10:07 PM

RSpec stub chain with arguments.

RSpec stub chain with arguments.

@github_double.stub_chain(:gists, :all).and_return([])
@github_double.gists.should_receive(:all).with({:per_page=>100, :page=>1}).and_return(all_gists_page_1)
@github_double.gists.should_receive(:all).with({:per_page=>100, :page=>2}).and_return([])