Sha256: e1e4dc123856d8fb01431a6c9a486c170e48bac0408ef6d975921b825d7f5ed8

Contents?: true

Size: 868 Bytes

Versions: 168

Compression:

Stored size: 868 Bytes

Contents

@Grab('org.spockframework:spock-core:1.0-groovy-2.4')
import spock.lang.*

class RomanNumeralsSpec extends Specification {

    // register metaclass on Integers
    def setup() { new RomanNumerals() }

    @Unroll
    def "can convert arabic #arabic to roman #roman"() {
        expect:
            arabic.roman == roman
        where:
            arabic | roman
            1      | 'I'
            2      | 'II'
            3      | 'III'
            4      | 'IV'
            5      | 'V'
            6      | 'VI'
            9      | 'IX'
            27     | 'XXVII'
            48     | 'XLVIII'
            59     | 'LIX'
            93     | 'XCIII'
            141    | 'CXLI'
            163    | 'CLXIII'
            402    | 'CDII'
            575    | 'DLXXV'
            911    | 'CMXI'
            1024   | 'MXXIV'
            3000   | 'MMM'
    }

}

Version data entries

168 entries across 168 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/groovy/exercises/roman-numerals/RomanNumeralsSpec.groovy
trackler-2.2.1.179 tracks/groovy/exercises/roman-numerals/RomanNumeralsSpec.groovy
trackler-2.2.1.178 tracks/groovy/exercises/roman-numerals/RomanNumeralsSpec.groovy
trackler-2.2.1.177 tracks/groovy/exercises/roman-numerals/RomanNumeralsSpec.groovy
trackler-2.2.1.176 tracks/groovy/exercises/roman-numerals/RomanNumeralsSpec.groovy
trackler-2.2.1.175 tracks/groovy/exercises/roman-numerals/RomanNumeralsSpec.groovy
trackler-2.2.1.174 tracks/groovy/exercises/roman-numerals/RomanNumeralsSpec.groovy
trackler-2.2.1.173 tracks/groovy/exercises/roman-numerals/RomanNumeralsSpec.groovy
trackler-2.2.1.172 tracks/groovy/exercises/roman-numerals/RomanNumeralsSpec.groovy
trackler-2.2.1.171 tracks/groovy/exercises/roman-numerals/RomanNumeralsSpec.groovy
trackler-2.2.1.170 tracks/groovy/exercises/roman-numerals/RomanNumeralsSpec.groovy
trackler-2.2.1.169 tracks/groovy/exercises/roman-numerals/RomanNumeralsSpec.groovy
trackler-2.2.1.167 tracks/groovy/exercises/roman-numerals/RomanNumeralsSpec.groovy
trackler-2.2.1.166 tracks/groovy/exercises/roman-numerals/RomanNumeralsSpec.groovy
trackler-2.2.1.165 tracks/groovy/exercises/roman-numerals/RomanNumeralsSpec.groovy
trackler-2.2.1.164 tracks/groovy/exercises/roman-numerals/RomanNumeralsSpec.groovy
trackler-2.2.1.163 tracks/groovy/exercises/roman-numerals/RomanNumeralsSpec.groovy
trackler-2.2.1.162 tracks/groovy/exercises/roman-numerals/RomanNumeralsSpec.groovy
trackler-2.2.1.161 tracks/groovy/exercises/roman-numerals/RomanNumeralsSpec.groovy
trackler-2.2.1.160 tracks/groovy/exercises/roman-numerals/RomanNumeralsSpec.groovy