Open GoogleCodeExporter opened 8 years ago
Original comment by julien.g...@gmail.com
on 3 Feb 2009 at 6:35
I still worry about that the users may be confused by the different means of
"returns".
Original comment by JohnnyJianHY
on 4 Feb 2009 at 3:09
Even if they are slightly different context both returns have the same meaning.
I
think users would instinctively understand this returns when used to the rest
of the api.
Original comment by julien.g...@gmail.com
on 4 Feb 2009 at 7:48
IMO, they have different meanings:
1. If this method is called, THEN return this value
2. While this closure is returned, the result SHOULD be this value
Original comment by JohnnyJianHY
on 4 Feb 2009 at 7:56
I understand they've got slight different meaning but a normal user would use
the
returns keyword he keep using everywhere.
1. Method called -> returns value
2. Closure called -> returns value
Original comment by julien.g...@gmail.com
on 4 Feb 2009 at 8:03
OK then.
Original comment by JohnnyJianHY
on 4 Feb 2009 at 9:33
Original comment by JohnnyJianHY
on 6 Mar 2009 at 12:08
Original comment by julien.g...@gmail.com
on 26 Apr 2009 at 9:28
Issue 107 has been merged into this issue.
Original comment by JohnnyJianHY
on 19 Feb 2011 at 11:04
A more complex example:
def m = mock()
m.unless(
invoke(3) { // a closure should be passed to unless() as parameter
// and invoke the closure with parameter "3"
current().returns(3) // expect current() to be called in the closure
}.returns(true) // expect the closure to return true
).returns(false)
play {
assert !m.unless { it == current() }
}
Original comment by JohnnyJianHY
on 19 Feb 2011 at 11:07
Original issue reported on code.google.com by
julien.g...@gmail.com
on 3 Feb 2009 at 6:34