Skip to content

Commit

Permalink
Continue to refactor AppendToTest (#939)
Browse files Browse the repository at this point in the history
  • Loading branch information
igor committed Jan 26, 2019
1 parent 5e93ac9 commit 43b4f6d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/cactoos/io/AppendTo.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public OutputStream stream() throws Exception {
if (!this.source.exists()) {
throw new IOException(
new FormattedText(
"Can not append to %s file. It does not exist",
"Can't append to %s file. It does not exist",
this.source.getAbsolutePath()
).asString()
);
Expand Down
8 changes: 4 additions & 4 deletions src/test/java/org/cactoos/io/AppendToTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
* Test case for {@link AppendTo}.
*
* @since 1.0
* @checkstyle MagicNumber (500 line)
* @checkstyle ClassDataAbstractionCouplingCheck (100 lines)
*/
public final class AppendToTest {
Expand All @@ -57,13 +56,14 @@ public final class AppendToTest {
*/
@Test
public void failsIfFileDoesNotExist() throws Exception {
// @checkstyle MagicNumber (1 line)
final File source = new File(new RandomText(5).asString());
new Assertion<>(
"Doesn't throw exception with proper message",
"Can't throw exception with proper message",
() -> () -> new AppendTo(source).stream(),
new Throws<>(
new FormattedText(
"Can not append to %s file. It does not exist",
"Can't append to %s file. It does not exist",
source.getAbsolutePath()
).asString(),
IOException.class
Expand Down Expand Up @@ -101,7 +101,7 @@ public void appendsUnicodeToFile() throws Exception {
final String second = "\\u25E6";
new AppendTo(source).stream().write(second.getBytes());
new Assertion<>(
"Does not contain expected unicode text",
"Can't find expected unicode text content",
() -> new TextOf(source),
new TextIs(new JoinedText("", first, second))
).affirm();
Expand Down

0 comments on commit 43b4f6d

Please sign in to comment.