title: Rspec, can you stub a method that doesn't exist on an object (or mock an object that can take any method)?
body: <p>This might sound like a terribly basic question... so let me explain the context. I'm retrieving an event from Stripe, but for the purposes of this, but this works for other things that I've considered.</p>
  
  <p>The data that I need in the Stripe object is way buried, so I'd have to do <code>event.data.object.date.lines.first.id</code>. I'm not sure how to mock/stub this...</p>
  
  <p>The only way I can think to do this is create a fake model that simulates a Stripe event object (in this example for me, keep in mind that Stripe events can't be user created). And then I can mock that fake model. But is that really the way to do it? Is there some way I can just use Rspec to stub the whole shebang and say that <code>event.data.object.date.lines.first.id</code> wherever it appears should just retun <code>1</code>?</p>
  
  <p>Oh and also... if not, and it turns out I do have to create a fake model... tips greatly appreciated, because right now I'm thinking this "Fake" model needs many layers of children, and is totally not worth the time investment.</p>