Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
FizzBuzz Test spec with ScalaTest
package org.scalabound.scatdd.scalatest
import org.junit.runner.RunWith
import org.scalatest.FunSpec
import org.scalatest.junit.JUnitRunner
import org.scalabound.scatdd.FizzBuzz
class FizzBuzzScalaTest extends FunSpec {
describe("A FizzBuzz processor") {
it("should return 'FizzBuzz' from a mulitple of three and five") { assert(FizzBuzz.eval(15) == "FizzBuzz") }
it("should return 'Fizz' from a multiple of three only") { assert(FizzBuzz.eval(12) == "Fizz") }
it("should return 'Buzz' from a multiple of five only") { assert(FizzBuzz.eval(10) == "Buzz") }
it("should return the stringified input from a non multiple of three or five") { assert(FizzBuzz.eval(11) == "11") }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.