From 5da7bbd6ee662653a090da58cbf63ecaf3dac548 Mon Sep 17 00:00:00 2001 From: yegor256 Date: Mon, 19 Jun 2017 10:11:05 +0200 Subject: [PATCH] more tests --- .../java/org/cactoos/io/ResourceAsInputTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test/java/org/cactoos/io/ResourceAsInputTest.java b/src/test/java/org/cactoos/io/ResourceAsInputTest.java index 6ead5ef855..cf3a7e9d25 100644 --- a/src/test/java/org/cactoos/io/ResourceAsInputTest.java +++ b/src/test/java/org/cactoos/io/ResourceAsInputTest.java @@ -23,6 +23,7 @@ */ package org.cactoos.io; +import java.io.IOException; import java.util.Arrays; import org.cactoos.text.BytesAsText; import org.hamcrest.MatcherAssert; @@ -93,4 +94,15 @@ public void readAbsentResourceTest() throws Exception { ); } + @Test(expected = IOException.class) + public void throwsWhenResourceIsAbsent() throws Exception { + new BytesAsText( + new InputAsBytes( + new ResourceAsInput( + "bar/this-resource-is-definitely-absent.txt" + ) + ) + ).asString(); + } + }