Spock Web Console

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

test

Published 2 years ago by Isakov
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 "A friquent flyer should be able to earn extra ststus points"() {
    given:
        def member = FrequentFlyer.withFrequentFlyerNumber("12345678").
                named("Ale","Isa").
                withStarusPoints(initialPoints)
    when:
         member.earns(additionalPoints).statusPoints()
    then:
         member.statusPoints == expectedPoints
    where:
        initialPoints    |additionalPoints    |expectedPoints
        0                |100                 |100
        100              |50                |150
  }
}