Spock Web Console

subscribe to the feed Subscribe
MyFirstSpecv2 (via #spockwebconsole)
tweet this script Tweet


Published 1 year ago by lajos with tags spock
Actions  ➤ Edit In Console Back To Console Show/Hide Line Numbers View Recent Scripts
import spock.lang.*

class MyFirstSpec extends Specification {
  def "let's play with stack"() {
    given: "an empty stack"
    def stack = new Stack()

    and: "an element"
    def elem = "push me"
    when: "we push the element into the stack"

    then: "the stack is not empty"

    and: "contains only the elemet we pushed"
    stack.size() == 1
    stack.peek() == elem