Last active
December 22, 2015 19:59
-
-
Save moniyax/6523591 to your computer and use it in GitHub Desktop.
Little scala assertion lib.
This file contains 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
import scala.language.implicitConversions | |
import scala.language.reflectiveCalls | |
// implicit def lilRock(foo : Int) = new { def mustEqual(actual : Int) : Boolean = actual == foo } | |
class Baz(actual: Int) { | |
def mustEqual(expected : Int) : Boolean = actual == expected | |
def mustBeGreaterThan(expected : Int) : Boolean = actual > expected | |
} | |
implicit def lilRock(actual : Int) = new Baz(actual) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment