Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

groovy

spock

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.

like image 882
JBT Avatar asked Oct 04 '13 18:10

JBT


1 Answers

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.

like image 185
Peter Niederwieser Avatar answered Nov 16 '22 04:11

Peter Niederwieser