From 569b88db69242612185c0f6a471261f1fcfc50f7 Mon Sep 17 00:00:00 2001 From: Roman Proshin Date: Fri, 4 May 2018 19:53:27 +0300 Subject: [PATCH] #759: Implement ScalarWithFallback - add another test case --- .../org/cactoos/scalar/ScalarWithFallbackTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/test/java/org/cactoos/scalar/ScalarWithFallbackTest.java b/src/test/java/org/cactoos/scalar/ScalarWithFallbackTest.java index e21ddaa434..e78cc7656f 100644 --- a/src/test/java/org/cactoos/scalar/ScalarWithFallbackTest.java +++ b/src/test/java/org/cactoos/scalar/ScalarWithFallbackTest.java @@ -143,4 +143,15 @@ public void usesTheClosestFallback() throws Exception { new ScalarHasValue<>(expected) ); } + + @Test(expected = Exception.class) + public void noFallbackIsProvided() throws Exception { + new ScalarWithFallback<>( + () -> { + throw new IllegalFormatWidthException(1); + }, + new IterableOf<>(), + input -> input + ).value(); + } }