Skip to content

Instantly share code, notes, and snippets.

@hrj
Created August 16, 2013 10:44
Show Gist options
  • Save hrj/6248920 to your computer and use it in GitHub Desktop.
Save hrj/6248920 to your computer and use it in GitHub Desktop.
Example matcher using Scala Test
def beEqui(to: collection.GenSeq[xml.Node]) = new Matcher[collection.GenSeq[xml.Node]] {
def apply(left: collection.GenSeq[xml.Node]) = {
val flatLeft = flatten(left)
val flatTo = flatten(to)
MatchResult(
flatLeft == flatten(to),
"xmls were not equivalent:\n%s and\n%s" format (flatLeft, flatTo),
"xmls were equivalent:\n%s and\n%s" format (flatLeft, flatTo))
}
}
@chetankothari
Copy link

a should beEqui(b)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment