Spock Web Console

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

DataPipeIndex

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

@Unroll 
class MyFirstSpec extends Specification {

  def "column1 value is #column1 and column2 value is #column2 where index is #index"() {
    expect:
    if(index in [0, 1]) {
        assert column1 < column2
    } else {
        assert column1 == column2
    }
    
    where:
    [column1, column2, index] << [[1, 2, 4, 5], [2, 3, 4, 5]].transpose().withIndex()*.flatten()    
  }
}