In Ruby each does not necessarily return a meaningful value (it could be nil or self for the object). You are stubbing a return value but each is used to yield to a block; which the stub does not do. Is this object actually an array? I’m a bit confused by it’s contract given your use of each and next with it.
In this situation, I generally would just suggest stubbing an array like object, I would say to just provide an array.
--
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 rspec+un...@googlegroups.com.
To post to this group, send email to rs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/9bae3a32-c918-430e-a108-33468455e439%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
*I would generally not suggest stubbing an array like object...