Skip to content

How to capture an argument to a mock? #2050

Answered by Vampire
efenderbosch-atg asked this question in Q&A
Discussion options

You must be logged in to vote

Is that in a then block?
If so, then it is moved by the compiler to before the according when block.
But the first line of your snippet stays in the then block and thus is not defined up where the interaction is placed now.
Wrap both expressions into an interaction { ... } block, then they are moved both together and it should work.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@efenderbosch-atg
Comment options

Answer selected by efenderbosch-atg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants