I have a mock of an instance of a class which descends from Array:

class ArrayDescendent < Array; end

#... in the specs...
@descendent = mock ArrayDescendent

How would I stub out ArrayDescendent#each, which is inherited from  
Array, to return multiple values successively?  I could use  
and_yield, but that is raising an arity error (the anonymous function/ 
block should expect only *one value at a time, but and_yield is  
yielding both values once).  Should I be using a lambda expression here?

Tips are welcome...Thanks,

Scott 
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to