package object common { import org.scalatest._ import org.scalatest.MustMatchers abstract class UnitSpec extends WordSpec with MustMatchers with LookAndSay { "1" must { """read off as "one 1" or 11.""" in { lookAndSay(1) must be("11") } } "11" must { """read off as "two 1s" or 21.""" in { lookAndSay(11) must be("21") } } "21" must { """read off as "one 2, then one 1" or 1211.""" in { lookAndSay(21) must be("1211") } } "1211" must { """read off as "one 1, then one 2, then two 1s" or 111221""" in { lookAndSay(1211) must be("111221") } } "111221" must { """read off as "three 1s, then two 2s, then one 1" or 312211.""" lookAndSay(111221) must be("312211") } } trait LookAndSay { def lookAndSay(seed: BigInt): String } }