Skip to content

Commit

Permalink
Fixed a minor formatting issue for JBehave embedded tables.
Browse files Browse the repository at this point in the history
  • Loading branch information
wakaleo committed Jun 2, 2015
1 parent 2e74fdf commit 08aba9b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ subprojects {
if (!JavaVersion.current().isJava8Compatible()) {
jvmArgs '-XX:MaxPermSize=256m'
}
// maxParallelForks = 2
maxParallelForks = 4
}

task integrationTests(type: Test) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public ExampleTable(String tableContents) {

public static String stripBracketsFromOuterPipes(String text) {
text = StringUtils.replace(text, "[|", "|");
text = StringUtils.replace(text, "[|", "|");
text = StringUtils.replace(text,"|]","|");
text = StringUtils.replace(text,"|]","|");
text = StringUtils.replace(text,LEFT_BRACKET + "|","|");
text = StringUtils.replace(text,"|" + RIGHT_BRACKET,"|");
return text;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,16 @@ public void should_convert_embedded_text_tables__with_square_brackets_into_html_
assertThat(formattedValue, is("A table:<br><table class='embedded'><thead><th>name</th><th>age</th></thead><tbody><tr><td>Bill</td><td>20</td></tr></tbody></table>"));
}

@Test
public void should_convert_embedded_jbehave_style_tables__with_square_brackets_into_html_tables() {
when(issueTracking.getShortenedIssueTrackerUrl()).thenReturn(null);
Formatter formatter = new Formatter(issueTracking);

String formattedValue = formatter.convertAnyTables("Given I have the following pet:\n[|name | status |\n|Fido | available |]");

assertThat(formattedValue, is("Given I have the following pet:<br><table class='embedded'><thead><th>name</th><th>status</th></thead><tbody><tr><td>Fido</td><td>available</td></tr></tbody></table>"));
}


@Test
public void should_ignore_isolated_pipes() {
Expand Down

0 comments on commit 08aba9b

Please sign in to comment.