title: RSpec: Mocks, Stubs and Verification
body: <p>I'm writing a plugin for <a href="https://github.com/cinchrb/cinch/" rel="nofollow">Cinch</a> (the IRC bot), and trying to write some RSpec tests for it.</p>
  
  <p>However, I'm trying to get to grips with RSpec, and mocking out the external dependencies of this plugin. I want to test two different things for now - that it says hello to people, and that it keeps track of who it's said hello to.</p>
  
  <p>So I've got a method, <code>say_hello</code>, which takes a <code>Cinch::Message</code>. What's the easiest way to mock this particular class? I'm used to Mockito and Java, so I'm used to making a mock of a particular class.</p>
  
  <p>How can I make a mock of <code>Cinch::Message</code>? In my first test, I want to assert that the <code>reply</code> method is called on that message. In the next one, I just want it to respond like a <code>Cinch::Message</code> would, as I only care about the tracking the class does, not the interaction with the message.</p>
  
  <p>I've only just started out with RSpec, so maybe I'm missing something fundamental. Should I be using a mock? A stub?</p>
  
  <p>Thanks!</p>