Skip to content

Commit

Permalink
Removed charset variable
Browse files Browse the repository at this point in the history
  • Loading branch information
g4s8 committed May 25, 2017
1 parent 4a28576 commit eb667c9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/test/java/org/cactoos/io/FileAsInputTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import org.cactoos.text.StringAsText;
import org.hamcrest.MatcherAssert;
Expand All @@ -34,6 +33,7 @@

/**
* Test case for {@link FileAsInput}.
*
* @author Yegor Bugayenko ([email protected])
* @version $Id$
* @since 0.1
Expand All @@ -42,20 +42,23 @@ public final class FileAsInputTest {

/**
* FileAsInput can read file content.
*
* @throws IOException If some problem inside
*/
@Test
public void readsFileContent() throws IOException {
final Charset utf = StandardCharsets.UTF_8;
final File temp = File.createTempFile("cactoos", "txt");
temp.deleteOnExit();
MatcherAssert.assertThat(
new InputAsText(
new TeeInput(
new TextAsInput(new StringAsText("Hello, друг!"), utf),
new TextAsInput(
new StringAsText("Hello, друг!"),
StandardCharsets.UTF_8
),
new FileAsOutput(temp)
),
utf
StandardCharsets.UTF_8
).asString(),
Matchers.allOf(
Matchers.equalTo(
Expand All @@ -66,5 +69,4 @@ public void readsFileContent() throws IOException {
)
);
}

}

0 comments on commit eb667c9

Please sign in to comment.