Last active
December 21, 2015 16:28
-
-
Save prystupa/6333618 to your computer and use it in GitHub Desktop.
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 com.prystupa | |
import org.scalatest.matchers.ShouldMatchers | |
import org.junit.runner.RunWith | |
import org.scalatest.junit.JUnitRunner | |
/** | |
* Created with IntelliJ IDEA. | |
* User: eprystupa | |
* Date: 8/24/13 | |
* Time: 11:37 PM | |
*/ | |
@RunWith(classOf[JUnitRunner]) | |
class MathSuite extends JasmineSpec with ShouldMatchers { | |
var x: Int = _ | |
var result: Int = _ | |
describe("A simple calculator") { | |
describe("when turned on") { | |
it("displays 0") { | |
result should equal(0) | |
} | |
describe("when I input 5") { | |
beforeEach { | |
x = 5 | |
} | |
describe("and multiple by 3") { | |
beforeEach { | |
result = x * 3 | |
} | |
it("shows 15") { | |
result should equal(15) | |
} | |
} | |
describe("and add by 3") { | |
beforeEach { | |
result = x + 3 | |
} | |
it("shows 8") { | |
result should equal(8) | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment