Created
August 16, 2013 10:44
-
-
Save hrj/6248920 to your computer and use it in GitHub Desktop.
Example matcher using Scala Test
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
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)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
a should beEqui(b)