Last active
January 23, 2016 16:30
-
-
Save NTCoding/00be25d314f9ba66737c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // return the stubbed value if the actual arguments match the expected arguments | |
| def ret[A,B](a: A)(b: B): A => B = | |
| x => if (x == a) b else throw ReturnFailed(s"$x did not equal $a") | |
| def ret[A,B,C](a: A, b: B)(c: C): (A,B) => C = | |
| (x, y) => if (x == a && y == b) c else throw ReturnFailed(s"$x and $y did not equal $a and $b") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment