This is my scenario:
After updating an AR object, it fires a bunch of background jobs with Resque. In my specs Iām mocking the call to Resque#enqueue, something in the lines of:
it 'should be published' do
# I need to setup these mocks in many places where I want to mock a specific call to Resque, otherwise it fails
Resque.should_receive(:enqueue).with(NotInterestedJob1, anything)
Resque.should_receive(:enqueue).with(NotInterestedJob2, anything)
Resque.should_receive(:enqueue).with(NotInterestedJob3, anything)
# I'm only interested in mocking this Resque call.
Resque.should_receive(:enqueue).with(PublishJob, anything)
end
As you can see, I need to mock all other calls to Resque#enqueue everytime I want to mock a specific call, is there a way to only mock a custom call and ignore the other calls with different arguments?
Thanks in advance ;)