Skip to content

Commit

Permalink
Added tests with and without quotes.
Browse files Browse the repository at this point in the history
  • Loading branch information
SherifWaly committed Mar 21, 2017
1 parent eb569a7 commit 091fbc8
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/test/java/com/amihaiemil/camel/NoCommentsYamlLineTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,25 @@ public void trimsCommentsLine() {
);
}

/**
* NoCommentsYamlLine removes only comments and leave original string.
*/
@Test
public void trimsCommentsAtEndOfLineWithoutQuotes() {
YamlLine noComments = new NoCommentsYamlLine(
new RtYamlLine(" this isn't comment #here is the comment", 1)
);
MatcherAssert.assertThat(
noComments.trimmed(), Matchers.is("this isn't comment")
);
}

/**
* NoCommentsYamlLine removes only comments and leaves original string.
* Original string has quotes.
*/
@Test
public void trimsCommentsAtEndOfLine() {
public void trimsCommentsAtEndOfLineWithQuotes() {
YamlLine noComments = new NoCommentsYamlLine(
new RtYamlLine(" \"this isn't comment\" #here is the comment", 1)
);
Expand Down

0 comments on commit 091fbc8

Please sign in to comment.