Sha256: 482f8f06112782cecd6fb94ee89536ffc6ee705bacdf7232b2646682aa0b9aa5

Contents?: true

Size: 1.13 KB

Versions: 206

Compression:

Stored size: 1.13 KB

Contents

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

class SquaresSpec extends Specification {

    @Unroll("can square the sum of the numbers up to #integer")
    def "can square the sum up to the given integer"() {
        expect:
            new Squares(integer).squareOfSums() == result
        where:
            integer | result
            5       | 225
            10      | 3025
            100     | 25502500
    }

    @Ignore
    @Unroll("can sum the squares up to #integer")
    def 'can sum the squares up to the given integer'() {
        expect:
            new Squares(integer).sumOfSquares() == result
        where:
            integer | result
            5       | 55
            10      | 385
            100     | 338350
    }

    @Ignore
    @Unroll("can subtract sum of squares from square of sums of #integer")
    def 'can subtract sum of squares from square of sums'() {
        expect:
            new Squares(integer).difference() == result
        where:
            integer | result
            0       | 0
            5       | 170
            10      | 2640
            100     | 25164150
    }

}

Version data entries

206 entries across 206 versions & 1 rubygems

Version Path
trackler-2.2.1.10 tracks/groovy/exercises/difference-of-squares/SquaresSpec.groovy
trackler-2.2.1.9 tracks/groovy/exercises/difference-of-squares/SquaresSpec.groovy
trackler-2.2.1.8 tracks/groovy/exercises/difference-of-squares/SquaresSpec.groovy
trackler-2.2.1.7 tracks/groovy/exercises/difference-of-squares/SquaresSpec.groovy
trackler-2.2.1.6 tracks/groovy/exercises/difference-of-squares/SquaresSpec.groovy
trackler-2.2.1.5 tracks/groovy/exercises/difference-of-squares/SquaresSpec.groovy
trackler-2.2.1.4 tracks/groovy/exercises/difference-of-squares/SquaresSpec.groovy
trackler-2.2.1.3 tracks/groovy/exercises/difference-of-squares/SquaresSpec.groovy
trackler-2.2.1.2 tracks/groovy/exercises/difference-of-squares/SquaresSpec.groovy
trackler-2.2.1.1 tracks/groovy/exercises/difference-of-squares/SquaresSpec.groovy
trackler-2.2.1.0 tracks/groovy/exercises/difference-of-squares/SquaresSpec.groovy
trackler-2.2.0.6 tracks/groovy/exercises/difference-of-squares/SquaresSpec.groovy
trackler-2.2.0.5 tracks/groovy/exercises/difference-of-squares/SquaresSpec.groovy
trackler-2.2.0.4 tracks/groovy/exercises/difference-of-squares/SquaresSpec.groovy
trackler-2.2.0.3 tracks/groovy/exercises/difference-of-squares/SquaresSpec.groovy
trackler-2.2.0.2 tracks/groovy/exercises/difference-of-squares/SquaresSpec.groovy
trackler-2.2.0.1 tracks/groovy/exercises/difference-of-squares/SquaresSpec.groovy
trackler-2.2.0.0 tracks/groovy/exercises/difference-of-squares/SquaresSpec.groovy
trackler-2.1.0.55 tracks/groovy/exercises/difference-of-squares/SquaresSpec.groovy
trackler-2.1.0.54 tracks/groovy/exercises/difference-of-squares/SquaresSpec.groovy