Skip to content

Instantly share code, notes, and snippets.

@moniyax
Last active December 22, 2015 19:59
Show Gist options
  • Save moniyax/6523591 to your computer and use it in GitHub Desktop.
Save moniyax/6523591 to your computer and use it in GitHub Desktop.
Little scala assertion lib.
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