Skip to content

Instantly share code, notes, and snippets.

@eed3si9n
Created July 9, 2011 21:30
Show Gist options
  • Save eed3si9n/1073975 to your computer and use it in GitHub Desktop.
Save eed3si9n/1073975 to your computer and use it in GitHub Desktop.
def beBasicallyFunctional(hosts: Seq[String] = Nil, db: Option[String] = None, collection: Option[String] = None,
login: Option[String] = None, password: Option[String] = None): org.specs2.matcher.Matcher[String] =
(_: String) match {
case MongoURI(h, d, c, l, p) => (h == hosts && d == db && c == collection && l == login && p == password, "doesn't match")
case default => (false, "parsing failed")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment