Re: [rspec-users] :render expects possible?

2007-08-02 Thread Edward Ocampo-Gooding
 Could we have at least a warning that mentions that parameters passed to
 :render expectations are going to be thrown away and mention an
 alternative way of spec-ing this behaviour?
>>> In trunk, when you call should_receive(:render) you will get an error
>>> saying you should use the new method (also in trunk)
>>> controller.expects_render.
>> Right on. Thanks for the tip.
>>
>> By the way, is there support for catching methods that haven't been
>> stubbed out on mock objects and throwing appropriate warnings?
> 
> Sorry but I don't really understand what you mean? Can you give an example?

Frustratingly, no. I tried to reproduce it with what I remember I had 
yesterday, but the bug that triggered the river of rspec debugging code 
has yet to resurface. (I think it had something to do with calling to_s 
on mock objects in a certain way, but I can't seem to remember.)

Basically, what I was trying to say was that I was hoping that if you 
had something like

   language = mock_model(Language)

then later called

   language.name

it would say something along the lines of "you've called a mock object's 
method that you forgot to stub", but I see that it already does this 
under normal conditions.

I'll let you know if I find the bug again.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


Re: [rspec-users] :render expects possible?

2007-08-01 Thread David Chelimsky
On 8/2/07, Edward Ocampo-Gooding <[EMAIL PROTECTED]> wrote:
> David Chelimsky wrote:
> > On 8/1/07, Edward Ocampo-Gooding <[EMAIL PROTECTED]> wrote:
> >> Hi,
> >>
> >> Is it possible to do the following in a controller spec?
> >>
> >>@controller.should_receive(:render).with(:layout => false)
> >>
> >> I've been trying this kind of thing and it looks like RSpec is messing
> >> with the render calls, and requires you to use render_template instead.
> >>
> >> Could we have at least a warning that mentions that parameters passed to
> >> :render expectations are going to be thrown away and mention an
> >> alternative way of spec-ing this behaviour?
> >
> > In trunk, when you call should_receive(:render) you will get an error
> > saying you should use the new method (also in trunk)
> > controller.expects_render.
>
> Right on. Thanks for the tip.
>
> By the way, is there support for catching methods that haven't been
> stubbed out on mock objects and throwing appropriate warnings?

Sorry but I don't really understand what you mean? Can you give an example?

> The last
> time this happened by accident, I just got a mess of rspec debugging log
> dumps.
> ___
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


Re: [rspec-users] :render expects possible?

2007-08-01 Thread Edward Ocampo-Gooding
David Chelimsky wrote:
> On 8/1/07, Edward Ocampo-Gooding <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> Is it possible to do the following in a controller spec?
>>
>>@controller.should_receive(:render).with(:layout => false)
>>
>> I've been trying this kind of thing and it looks like RSpec is messing
>> with the render calls, and requires you to use render_template instead.
>>
>> Could we have at least a warning that mentions that parameters passed to
>> :render expectations are going to be thrown away and mention an
>> alternative way of spec-ing this behaviour?
> 
> In trunk, when you call should_receive(:render) you will get an error
> saying you should use the new method (also in trunk)
> controller.expects_render.

Right on. Thanks for the tip.

By the way, is there support for catching methods that haven't been 
stubbed out on mock objects and throwing appropriate warnings? The last 
time this happened by accident, I just got a mess of rspec debugging log 
dumps.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


Re: [rspec-users] :render expects possible?

2007-08-01 Thread David Chelimsky
On 8/1/07, Edward Ocampo-Gooding <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Is it possible to do the following in a controller spec?
>
>@controller.should_receive(:render).with(:layout => false)
>
> I've been trying this kind of thing and it looks like RSpec is messing
> with the render calls, and requires you to use render_template instead.
>
> Could we have at least a warning that mentions that parameters passed to
> :render expectations are going to be thrown away and mention an
> alternative way of spec-ing this behaviour?

In trunk, when you call should_receive(:render) you will get an error
saying you should use the new method (also in trunk)
controller.expects_render.

Cheers,
David

> Thanks,
> Edward
> ___
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users