[rspec-users] Class method not being stubbed

Nick Hoffman nick at deadorange.com
Sun May 24 12:25:18 EDT 2009


Hi guys. I'm setting an expectation on a class method. For some
reason, the method isn't being stubbed, and the expectation isn't
seeing the call.

In KeywordListsController#create, I call the private method
#create_keywords_and_associate, which calls AdSenseHeavenParser#parse
.

Thus, some of my specs set an expectation on AdSenseHeavenParser#parse
. However, that expectation isn't stubbing out #parse .

In the "output" section of my paste:
    http://pastie.org/488160
you can see that the second line is "*** create_keywords_and_associate
***". However, that string shouldn't be printed if
AdSenseHeavenParser#parse is stubbed out.

I've been beating my head against this for a couple of hours. Any thoughts?

Thanks,
Nick


More information about the rspec-users mailing list