Created
          May 22, 2012 12:13 
        
      - 
      
- 
        Save awilmore/2768688 to your computer and use it in GitHub Desktop. 
    Scala Specs Example
  
        
  
    
      This file contains hidden or 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
    
  
  
    
  | 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