Created
May 28, 2012 10:50
-
-
Save kings13y/2818471 to your computer and use it in GitHub Desktop.
FizzBuzz Test spec with ScalaTest
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
package org.scalabound.scatdd.scalatest | |
import org.junit.runner.RunWith | |
import org.scalatest.FunSpec | |
import org.scalatest.junit.JUnitRunner | |
import org.scalabound.scatdd.FizzBuzz | |
@RunWith(classOf[JUnitRunner]) | |
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