Spock Web Console

subscribe to the feed Subscribe
test unshared variables (via #spockwebconsole)
tweet this script Tweet

test unshared variables

Published 3 months ago by justAtest with tags Basic
Actions  ➤ Edit In Console Back To Console Show/Hide Line Numbers View Recent Scripts
import spock.lang.*

// Hit 'Run Script' below
class MyFirstSpec extends Specification {

    @Shared
    def a = 1 


  def "let's try this!"() {
println a
a +=1
println a
    expect:
    Math.max(1, 2) == 2
  }

def "let's try this!"() {
println a
a +=1
println a
    expect:
    Math.max(1, 2) == 2
  }
}