Responses for exercises in Exercism.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

36 lines
711 B

import spock.lang.*
class TwoFerSpec extends Specification {
def "No name given"() {
expect:
TwoFer.twoFer() == 'One for you, one for me.'
}
def "Empty name given"() {
expect:
TwoFer.twoFer(name) == expected
where:
name || expected
'' || 'One for you, one for me.'
}
def "A name given"() {
expect:
TwoFer.twoFer(name) == expected
where:
name || expected
'Alice' || 'One for Alice, one for me.'
}
def "Another name given"() {
expect:
TwoFer.twoFer(name) == expected
where:
name || expected
'Bob' || 'One for Bob, one for me.'
}
}