Skip to content

Instantly share code, notes, and snippets.

@prystupa
Last active December 21, 2015 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prystupa/6333618 to your computer and use it in GitHub Desktop.
Save prystupa/6333618 to your computer and use it in GitHub Desktop.
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