From a48edce4b4192c994b0e73b9e4605a02de2c4739 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Fri, 20 Dec 2013 09:02:14 -0500 Subject: [PATCH] Add a test that we can get values from an unresolved config --- .../scala/com/typesafe/config/impl/PublicApiTest.scala | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config/src/test/scala/com/typesafe/config/impl/PublicApiTest.scala b/config/src/test/scala/com/typesafe/config/impl/PublicApiTest.scala index 3c8be585..e95f4261 100644 --- a/config/src/test/scala/com/typesafe/config/impl/PublicApiTest.scala +++ b/config/src/test/scala/com/typesafe/config/impl/PublicApiTest.scala @@ -908,4 +908,13 @@ class PublicApiTest extends TestUtils { assertTrue("stuff gets cached repeatedly sys", sys3 eq sys4) assertTrue("stuff gets cached repeatedly conf", conf3 eq conf4) } + + @Test + def canUseSomeValuesWithoutResolving(): Unit = { + val conf = ConfigFactory.parseString("a=42,b=${NOPE}") + assertEquals(42, conf.getInt("a")) + intercept[ConfigException.NotResolved] { + conf.getInt("b") + } + } }