Skip to content

Commit

Permalink
#36 Show the original text on a test's fail.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitalii Samolovskikh authored and Vitalii Samolovskikh committed Jan 23, 2016
1 parent e08eda6 commit 561f10e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/org/kefirsf/bb/test/Assert.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import org.kefirsf.bb.TextProcessor;

import java.text.MessageFormat;

/**
* Class contains static assert methods
*
Expand All @@ -26,6 +28,10 @@ protected Assert() {
* @param source source text
*/
public static void assertProcess(TextProcessor processor, String expected, CharSequence source) {
assertEquals(expected, processor.process(source).toString());
assertEquals(
MessageFormat.format("When parsing text: {0}", source),
expected,
processor.process(source).toString()
);
}
}

0 comments on commit 561f10e

Please sign in to comment.