What is the definition of double right arrow operator ( >> ) in Spock?
Asked Answered
P

1

16

There are code snippets in this Spock wiki page that involve double right arrow operators (>>). For example:

setup:
subscriber.isAlive() >> true

So, what does the >> operator mean in this case? Thank you very much.

Pyrochemical answered 4/10, 2013 at 18:8 Comment(0)
M
20

The right-shift (>>) operator defines the return value or behavior of a stubbed method. You can find more information under Stubbing in the reference documentation.

Mountainous answered 4/10, 2013 at 18:13 Comment(1)
I'm guessing they used the operator overloading feature of groovy to do this #6486361Outside

© 2022 - 2024 — McMap. All rights reserved.