Skip to content

Instantly share code, notes, and snippets.

@awilmore
Created May 22, 2012 12:13
Show Gist options
  • Save awilmore/2768688 to your computer and use it in GitHub Desktop.
Save awilmore/2768688 to your computer and use it in GitHub Desktop.
Scala Specs Example
import org.specs2.mutable._
import org.junit.runner._
import org.specs2.runner._
@RunWith(classOf[JUnitRunner])
class PrimeSpec extends Specification {
"The 'Prime' object" should {
"determine prime" in {
Prime.is(7919) must beTrue
}
"determine not prime" in {
Prime.is(1000) must beFalse
}
"determine largest factor" in {
Prime.largestFactor(13195) must beEqualTo(29)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment