I need to set expectation on one single argument. How can I access the received arguments from RSpec?
Here is what I want to achieve.
let(:api) { double('API') }
it "should pass :filter in options" do
api.should_receive(:traverse)
subject.execute
args = api.recevied_arguments_for(:traverse) # How to obtain all the arguments?
args[0].should have_key(:filter)
end
To answer the question, fix the line with the comment.
Thanks.
Just figured it out.
Much better than I thought.