spy_rb
spy_rb copied to clipboard
allow for multiple chains of `when` and `instead` for spies
see https://github.com/jbodah/spy_rb/commit/c51d86d78f77e85d005184907bc62d622188ec35#diff-54fff610a17d610014b1df764d936cb3R54
We can do this by returning builder proxies and storing those. They can chain and delegate back to the parent Spy object as needed
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