diff options
Diffstat (limited to 'src/test/scala/RichTraversableOnceSpec.scala')
-rw-r--r-- | src/test/scala/RichTraversableOnceSpec.scala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/scala/RichTraversableOnceSpec.scala b/src/test/scala/RichTraversableOnceSpec.scala new file mode 100644 index 0000000..8f236ee --- /dev/null +++ b/src/test/scala/RichTraversableOnceSpec.scala @@ -0,0 +1,15 @@ +import org.specs2.mutable._ +import com.getbootstrap.no_carrier.util.RichTraversableOnce + +class RichTraversableOnceSpec extends Specification { + "maxOption" should { + "be None when the collection is empty" in { + val emptySeq: Seq[Int] = Seq() + emptySeq.maxOption must beNone + } + "be the maximum when the collection is non-empty" in { + Seq(7).maxOption mustEqual Some(7) + Seq(1, 2, 6, 5, 4).maxOption mustEqual Some(6) + } + } +} |