Skip to content

Commit

Permalink
#431: Added bad weather test scenario.
Browse files Browse the repository at this point in the history
  • Loading branch information
redcatbear committed Jan 6, 2025
1 parent 290b228 commit d64456d
Showing 1 changed file with 37 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,47 @@ void testWhenInsideMarkdownCodeBlockThenNoSpecificationItemMustBeDetected(final
final String endMarker)
{
assertImport("file_with_code_block.md", """
%s
This is a code block, the following requirement must be ignored.
%s
This is a code block, the following requirement must be ignored.
req~example~1
%s
""".formatted(startMarker, endMarker),
req~example~1
%s
""".formatted(startMarker, endMarker),
emptyIterable());
}

// Unit Test
@ParameterizedTest
@CsvSource(
{
"'', ''",
"', '",
"'`', '`'",
"'``', '``'",
"'````', '````'",
"'``` ', ' ```'",
"'``` ', ' ```'",
"' ```', '``` '",
"'```java ', ' ```java'",
"'~~~', '~~~'",
"'~~~java', '~~~java'",
"'~~~~java ', ' ~~~~java '"
})
void testWhenNotInsideMarkdownCodeBlockThenSpecificationItemMustBeDetected(final String startMarker,
final String endMarker)
{
assertImport("file_without_code_block.md", """
%s
This is not a code block, the following requirement must be detected.
req~example~1
%s
""".formatted(startMarker, endMarker),
contains(item()
.id(SpecificationItemId.parseId("req~example~1"))
.location("file_without_code_block.md", 4)
.build()));
}

@Test
void testWhenCodeBlockIsInsideCommentSectionThenItIsImportedAsPartOfComment()
{
Expand Down

0 comments on commit d64456d

Please sign in to comment.