String lineSeparator = System.getProperty("line.separator");
FileDiffs diffs = comparator.compareContents(actual, expected, charset);
if (!diffs.isEmpty()) {
String format = "files expected:<%s> and actual:<%s> do not have equal content:" + lineSeparator + "%s"
+ lineSeparator + "using charset:<%s>";
throw failures.failure(description, new BasicErrorMessageFactory(format, expected, actual, diffs, charset));
}
} catch (IOException e) {
String format = "Failed to compare contents of files:<%s> and:<%s> using charset:<%s>";
throw new IORuntimeException(String.format(format, actual, expected, charset), e);
}