Search in sources :

Example 1 with Sticky

use of org.cactoos.io.Sticky in project cactoos by yegor256.

the class BytesOfTest method readsFromReader.

@Test
void readsFromReader() throws Exception {
    final String source = "hello, друг!";
    new Assertion<>("must read string through a reader", new TextOf(new Sticky(new InputOf(new BytesOf(new StringReader(source), StandardCharsets.UTF_8, // @checkstyle MagicNumberCheck (1 line)
    16 << 10)))), new IsText(source)).affirm();
}
Also used : StringReader(java.io.StringReader) IsText(org.llorllale.cactoos.matchers.IsText) TextOf(org.cactoos.text.TextOf) HasString(org.llorllale.cactoos.matchers.HasString) InputOf(org.cactoos.io.InputOf) Sticky(org.cactoos.io.Sticky) Test(org.junit.jupiter.api.Test)

Aggregations

StringReader (java.io.StringReader)1 InputOf (org.cactoos.io.InputOf)1 Sticky (org.cactoos.io.Sticky)1 TextOf (org.cactoos.text.TextOf)1 Test (org.junit.jupiter.api.Test)1 HasString (org.llorllale.cactoos.matchers.HasString)1 IsText (org.llorllale.cactoos.matchers.IsText)1