title: RSpec should_receive not reaching method in class
body: <p>New to ruby/rspec and trying to test that a method raises an exception.  I may be going about this entirely incorrectly.</p>
  
  <pre><code>#require 'rspec'
  
  describe "TestClass" do
    it "should raise exception when my method is called" do
      test = Test.new
      test.should_receive(:my_method).and_raise
    end
  end
  
  class Test
    def my_method
      raise
    end
  end  
  
  
  rspec test.rb
  F
  
  Failures:
  
    1) TestClass should raise exception when my method is called
       Failure/Error: test.should_receive(:my_method).and_raise
         (#&lt;Test:0x007fc61c82f7c8&gt;).my_method(any args)
             expected: 1 time
             received: 0 times
       # ./test.rb:6:in `block (2 levels) in &lt;top (required)&gt;'
  
  Finished in 0.00061 seconds
  1 example, 1 failure
  
  Failed examples:
  
  rspec ./test.rb:4 # TestClass should raise exception when my method is called
  </code></pre>
  
  <p>Why is the message received zero times?</p>