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

Remi Gagnon rem.gagnon at gmail.com
Sun Feb 8 10:26:00 EST 2009


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 <dchelimsky at gmail.com>wrote:

> On Sun, Feb 8, 2009 at 6:48 AM, Remi Gagnon <rem.gagnon at gmail.com> 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 not
> sure what you're getting at here. Are you saying that you want the
> method to return the value of an @value instance variable in the
> object?
>
> >
> > Rémi
> >
> > _______________________________________________
> > rspec-users mailing list
> > rspec-users at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/rspec-users
> >
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090208/04728e5a/attachment-0001.html>


More information about the rspec-users mailing list