Skip to content

Commit

Permalink
compare json by AST, not string
Browse files Browse the repository at this point in the history
  • Loading branch information
squito committed Feb 23, 2015
1 parent cd37845 commit b6a96a8
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,12 @@ class HistoryServerSuite extends FunSuite with BeforeAndAfter with Matchers {
errOpt should be (None)
val json = jsonOpt.get
val exp = IOUtils.toString(new FileInputStream(new File(expRoot, path + "/json_expectation")))
json should be (exp)
//compare the ASTs so formatting differences don't cause failures
import org.json4s._
import org.json4s.jackson.JsonMethods._
val jsonAst = parse(json)
val expAst = parse(exp)
jsonAst should be (expAst)
}
}

Expand Down

0 comments on commit b6a96a8

Please sign in to comment.