Re: [rspec-users] How to return a value passed by ref to a method

2009-02-08 Thread Scott Taylor
Remi Gagnon wrote: Hi, I have a recursive method and I want to mock a var passed by ref. Object.should_receive(:my_method).and_return"by_ref"(@value) Often a way to spec a recursive function is to alias it, and have the recursive call call the alias. So if you want to check the recursion,

Re: [rspec-users] How to return a value passed by ref to a method

2009-02-08 Thread Remi Gagnon
Hello, This is a question from one of my teammate, I'll revalidate tomorrow with him what is his issue. Thank you Rémi On Sun, Feb 8, 2009 at 10:02 AM, David Chelimsky wrote: > On Sun, Feb 8, 2009 at 6:48 AM, Remi Gagnon wrote: > > Hi, > > > > I have a recursive method and I want to mock a va

Re: [rspec-users] How to return a value passed by ref to a method

2009-02-08 Thread David Chelimsky
On Sun, Feb 8, 2009 at 6:48 AM, Remi Gagnon wrote: > Hi, > > I have a recursive method and I want to mock a var passed by ref. > Object.should_receive(:my_method).and_return"by_ref"(@value) > > Something like that. > > Any idea? AFAIK, Ruby has no language construct for "by_ref/by_val," so I'm no

[rspec-users] How to return a value passed by ref to a method

2009-02-08 Thread Remi Gagnon
Hi, I have a recursive method and I want to mock a var passed by ref. Object.should_receive(:my_method).and_return"by_ref"(@value) Something like that. Any idea? Rémi ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/