spy_rb icon indicating copy to clipboard operation
spy_rb copied to clipboard

allow for multiple chains of `when` and `instead` for spies

Open jbodah opened this issue 8 years ago • 2 comments

see https://github.com/jbodah/spy_rb/commit/c51d86d78f77e85d005184907bc62d622188ec35#diff-54fff610a17d610014b1df764d936cb3R54

jbodah avatar Jul 01 '16 15:07 jbodah

We can do this by returning builder proxies and storing those. They can chain and delegate back to the parent Spy object as needed

jbodah avatar May 10 '18 02:05 jbodah

In summary:

  • We should allow the same object to be spied multi times (under the hood there should be one spy instance)
  • We should allow multiple conditions to be specified which will form branches (we will branch internally)
  • Calling Spy.on will yield a new branch; branches are mutable and independent so that you can have multiple branches
  • Branches are resolved in FIFO order

jbodah avatar Jan 20 '19 13:01 jbodah