Sha256: ec561e3b8c72601e041b4f81c441214e30b121eac7a4734a336c65628d1cd5be
Contents?: true
Size: 1.26 KB
Versions: 236
Compression:
Stored size: 1.26 KB
Contents
import org.scalatest.{Matchers, FlatSpec} class AccumulateTest extends FlatSpec with Matchers { it should "allow empty accumulation" in { val accumulate = new Accumulate val accumulation = accumulate.accumulate[Int, Int](x => x * x, List.empty) accumulation should be (List.empty) } it should "accumulate squares" in { pending val accumulate = new Accumulate val accumulation = accumulate.accumulate[Int, Int](x => x * x, List(1, 2, 3)) accumulation should be (List(1, 4, 9)) } it should "accumulate upcases" in { pending val accumulate = new Accumulate val accumulation = accumulate.accumulate[String, String](_.map(_.toUpper), List("hello", "world")) accumulation should be (List("HELLO", "WORLD")) } it should "accumulate reversed strings" in { pending val accumulate = new Accumulate val accumulation = accumulate.accumulate[String, String](_.reverse, List("eht", "kciuq", "nworb", "xof", "cte")) accumulation should be (List("the", "quick", "brown", "fox", "etc")) } it should "allow different return type" in { pending val accumulate = new Accumulate val accumulation = accumulate.accumulate[Int, String](_.toString, List(1, 2, 3)) accumulation should be (List("1", "2", "3")) } }
Version data entries
236 entries across 236 versions & 1 rubygems