Re: [rspec-users] Class method not being stubbed

2009-05-28 Thread Nick Hoffman
On Sun, May 24, 2009 at 3:25 PM, Rick DeNatale wrote: > One thing which strikes me is that if Rails naming conventions were > being followed: > >  1) the file name be lib/ad_sense_heaven_parser not lib/adsense_heaven_parser >  2) the require wouldn't be needed since it would be autoloaded. > > Per

Re: [rspec-users] Class method not being stubbed

2009-05-24 Thread Mark Wilden
On Sun, May 24, 2009 at 9:25 AM, Nick Hoffman wrote: > > 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

Re: [rspec-users] Class method not being stubbed

2009-05-24 Thread Nick Hoffman
On Sun, May 24, 2009 at 3:25 PM, Rick DeNatale wrote: >> However, that doesn't really matter. The call to #require shouldn't >> happen, because the method is supposed to be stubbed out. > > No that's what confused me. > > class KeywordListsController < ApplicationController > ... >   private > ...

Re: [rspec-users] Class method not being stubbed

2009-05-24 Thread Nick Hoffman
>> Hi Fernando. I'm not sure what you mean by "the code never gets out of >> this require statement". > I should have said 'the interpreter never ...' Ah, I understand what you mean now. >> However, that doesn't really matter. The call to #require shouldn't >> happen, because the method is suppos

Re: [rspec-users] Class method not being stubbed

2009-05-24 Thread Rick DeNatale
On Sun, May 24, 2009 at 2:24 PM, Nick Hoffman wrote: > On Sun, May 24, 2009 at 2:13 PM, Fernando Perez wrote: >>> Hi Fernando. In this case, I don't think it's a matter of using the >>> debugger. >> >> I suspect a problem in: require 'lib/adsense_heaven_parser', the code >> maybe never gets out o

Re: [rspec-users] Class method not being stubbed

2009-05-24 Thread Fernando Perez
> Hi Fernando. I'm not sure what you mean by "the code never gets out of > this require statement". I should have said 'the interpreter never ...' > However, that doesn't really matter. The call to #require shouldn't > happen, because the method is supposed to be stubbed out. You are making a lot

Re: [rspec-users] Class method not being stubbed

2009-05-24 Thread Nick Hoffman
On Sun, May 24, 2009 at 2:13 PM, Fernando Perez wrote: >> Hi Fernando. In this case, I don't think it's a matter of using the >> debugger. > > I suspect a problem in: require 'lib/adsense_heaven_parser', the code > maybe never gets out of this require statement. The debugger would allow > you to i

Re: [rspec-users] Class method not being stubbed

2009-05-24 Thread Fernando Perez
> Hi Fernando. In this case, I don't think it's a matter of using the > debugger. I suspect a problem in: require 'lib/adsense_heaven_parser', the code maybe never gets out of this require statement. The debugger would allow you to immediately clear things out. -- Posted via http://www.ruby-fo

Re: [rspec-users] Class method not being stubbed

2009-05-24 Thread Nick Hoffman
On Sun, May 24, 2009 at 1:10 PM, Rick DeNatale wrote: > On Sun, May 24, 2009 at 12:25 PM, Nick Hoffman wrote: >> 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

Re: [rspec-users] Class method not being stubbed

2009-05-24 Thread Rick DeNatale
On Sun, May 24, 2009 at 12:25 PM, Nick Hoffman wrote: > 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_asso

Re: [rspec-users] Class method not being stubbed

2009-05-24 Thread Nick Hoffman
On Sun, May 24, 2009 at 12:49 PM, Fernando Perez wrote: >> I've been beating my head against this for a couple of hours. Any >> thoughts? > The easiest for you is to use the debugger and go through each line in > the controller. > > Maybe @keyword_list.save is returning false? Stub it out and see

Re: [rspec-users] Class method not being stubbed

2009-05-24 Thread Fernando Perez
> I've been beating my head against this for a couple of hours. Any > thoughts? The easiest for you is to use the debugger and go through each line in the controller. Maybe @keyword_list.save is returning false? Stub it out and see by yourself. -- Posted via http://www.ruby-forum.com/. __

[rspec-users] Class method not being stubbed

2009-05-24 Thread Nick Hoffman
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 s