Skip to content

Commit

Permalink
Continue to refactor tests (yegor256#1023)
Browse files Browse the repository at this point in the history
  • Loading branch information
igor committed Jan 20, 2019
1 parent d3f328b commit d6ae230
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
10 changes: 6 additions & 4 deletions src/test/java/org/cactoos/io/BytesOfTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,12 @@ public void printsStackTrace() {
)
)
),
Matchers.allOf(
new TextHasString("java.io.IOException"),
new TextHasString("doesn't work at all"),
new TextHasString("\tat org.cactoos.io.BytesOfTest")
new TextHasString(
new JoinedText(
System.lineSeparator(),
"java.io.IOException: It doesn't work at all",
"\tat org.cactoos.io.BytesOfTest"
)
)
);
}
Expand Down
7 changes: 2 additions & 5 deletions src/test/java/org/cactoos/io/InputOfTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
import org.llorllale.cactoos.matchers.EndsWith;
import org.llorllale.cactoos.matchers.InputHasContent;
import org.llorllale.cactoos.matchers.MatcherOf;
import org.llorllale.cactoos.matchers.StartsWith;
import org.llorllale.cactoos.matchers.MatchesRegex;
import org.llorllale.cactoos.matchers.TextHasString;
import org.takes.http.FtRemote;
import org.takes.tk.TkHtml;
Expand Down Expand Up @@ -151,10 +151,7 @@ public void readsRealUrl() throws IOException {
new TextOf(
new InputOf(home)
),
Matchers.allOf(
new StartsWith("<html"),
new EndsWith("html>")
)
new MatchesRegex("<html.*html>")
)
);
}
Expand Down
10 changes: 6 additions & 4 deletions src/test/java/org/cactoos/text/TextOfTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,12 @@ public void printsStackTrace() {
"It doesn't work at all"
)
),
Matchers.allOf(
new TextHasString("java.io.IOException"),
new TextHasString("doesn't work at all"),
new TextHasString("\tat org.cactoos.text.TextOfTest")
new TextHasString(
new JoinedText(
System.lineSeparator(),
"java.io.IOException: It doesn't work at all",
"\tat org.cactoos.text.TextOfTest"
)
)
);
}
Expand Down

0 comments on commit d6ae230

Please sign in to comment.