>
>
> You can stub any arbitrary chain of methods by setting up the stubs
> individually:
>
> allow(a).to receive(:foo).with(1).and_return(b = double)
> allow(b).to receive(:bar).with(2).and_return(c = double)
> allow(c).to receive(:baz).with(3).and_return("it worked")
>
> expect(a.foo(1).bar(2).baz(3)).to eq("it worked")
>
> HTH,
> Myron
>
Myron,
Is this accepted answer is wrong approach to the problem as given ?
http://stackoverflow.com/a/8522108/2767755
--
You received this message because you are subscribed to the Google Groups
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rspec/e5989cf9-93ce-4a24-8803-9c1cad431164%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.