Spock Web Console

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

Multi notThrown

Published 1 year ago by Gareth with tags notthrown
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 {
  def "let's try this!"() {
    when:
    Math.max(1, 2) == 3
    
    then:
    notThrown exception
     
    where:
    exception << [NullPointerException, NumberFormatException, AssertionError]
  }
}