-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Assertion errors shown in the HTML report respect line breaks now (fixes
#234)
- Loading branch information
Jan Schäfer
committed
Oct 14, 2016
1 parent
21b472f
commit 7413263
Showing
7 changed files
with
53 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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
26 changes: 26 additions & 0 deletions
26
jgiven-examples/src/test/java/com/tngtech/jgiven/examples/FailingScenarioTest.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.tngtech.jgiven.examples; | ||
|
||
import com.tngtech.jgiven.examples.tags.FailingOnPurpose; | ||
import com.tngtech.jgiven.junit.SimpleScenarioTest; | ||
import com.tngtech.jgiven.tags.Issue; | ||
import org.junit.Test; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
@FailingOnPurpose | ||
public class FailingScenarioTest extends SimpleScenarioTest<FailingScenarioTest.Steps> { | ||
|
||
|
||
|
||
@Test | ||
@Issue("#234") | ||
public void a_scenario_with_a_multi_line_error_message() { | ||
given().multi_line_error_message(); | ||
} | ||
|
||
public static class Steps { | ||
public void multi_line_error_message() { | ||
assertThat(true).as("This\nmessage\nhas\nmultiple lines").isFalse(); | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
11 changes: 11 additions & 0 deletions
11
jgiven-examples/src/test/java/com/tngtech/jgiven/examples/tags/FailingOnPurpose.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.tngtech.jgiven.examples.tags; | ||
|
||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
|
||
import com.tngtech.jgiven.annotation.IsTag; | ||
|
||
@IsTag(description = "Scenarios that fail on purpose, to demonstrate how errors appear in JGiven") | ||
@Retention( RetentionPolicy.RUNTIME ) | ||
public @interface FailingOnPurpose { | ||
} |
This file contains 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