Sha256: 0f2778ce01c672c32b33ef1cbe33113f72c67786277bc1f8fbc3d79dfa694fd4
Contents?: true
Size: 1.03 KB
Versions: 134
Compression:
Stored size: 1.03 KB
Contents
@Grab('org.spockframework:spock-core:1.0-groovy-2.4') import spock.lang.* class ScrabbleScoreSpec extends Specification { def 'lowercase letter'() { expect: ScrabbleScore.scoreWord('a') == 1 } def 'uppercase letter'() { expect: ScrabbleScore.scoreWord('A') == 1 } def 'valuable letter'() { expect: ScrabbleScore.scoreWord('f') == 4 } def 'empty input'() { expect: ScrabbleScore.scoreWord('') == 0 } @Unroll def 'score for word #word should be #expectedScore'() { when: def score = ScrabbleScore.scoreWord(word) then: score == expectedScore where: word | expectedScore 'at' | 2 'zoo' | 12 'street' | 6 'quirky' | 22 'OxyphenButazone' | 41 'pinata' | 8 'abcdefghijklmnopqrstuvwxyz' | 87 } }
Version data entries
134 entries across 134 versions & 1 rubygems