-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
51 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/test/scala/org/broadinstitute/dsde/workbench/sam/config/NonEmptyListConfigSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.broadinstitute.dsde.workbench.sam.config | ||
|
||
import cats.data.NonEmptyList | ||
import org.scalatest.{FlatSpec, Matchers} | ||
import com.typesafe.config._ | ||
import net.ceedubs.ficus.Ficus._ | ||
|
||
class NonEmptyListConfigReaderSpec extends FlatSpec with Matchers { | ||
"NonEmptyListConfigReader" should "read missing list" in { | ||
val c = ConfigFactory.empty() | ||
val test = c.as[Option[NonEmptyList[String]]]("test") | ||
test should equal(None) | ||
} | ||
|
||
it should "read empty list" in { | ||
val c = ConfigFactory.parseString("test = []") | ||
val test = c.as[Option[NonEmptyList[String]]]("test") | ||
test should equal(None) | ||
} | ||
|
||
it should "read non empty list" in { | ||
val c = ConfigFactory.parseString("test = [foo, bar]") | ||
val test = c.as[Option[NonEmptyList[String]]]("test") | ||
test should equal(Some(NonEmptyList.of("foo", "bar"))) | ||
} | ||
|
||
} |