Spock Web Console

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

MyFirstSpec

Published 2 months 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 try this!"() {
    given:
    def stack = new Stack()
    def elem = "push me"
    
    when:
    stack.push(elem)

    then:
    !stack.isEmpty()
    stack.size() == 1
    stack.peek() == elem
  }

}