Sha256: 42f4eaa396c8160a72a966036ba7a75e1909b2cadbc8eb94bddf29f4260fae47

Contents?: true

Size: 1.17 KB

Versions: 101

Compression:

Stored size: 1.17 KB

Contents

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

class GigasecondSpec extends Specification {

    def gigasecond = new Gigasecond()

    def 'calculates one gigasecond after a date'() {
        given:
            def start = Date.parse('yyyy-MMM-dd', '2011-Apr-25')
        when:
            def result = gigasecond.from(start)
        then:
            result == Date.parse('yyyy-MMM-dd hh:mm:ss', '2043-Jan-01 01:46:40')
    }

    @Ignore
    def 'calculates one gigasecond after a date with hours and minutes'() {
        given:
            def start = Date.parse('yyyy-MMM-dd hh:mm', '1959-Jul-19 12:31')
        when:
            def result = gigasecond.from(start)
        then:
            result == Date.parse('yyyy-MMM-dd hh:mm:ss', '1991-Mar-27 02:17:40')
    }

    @Ignore
    def 'calculates one gigasecond after a date with hours and minutes and seconds'() {
        given:
            def start = Date.parse('yyyy-MMM-dd hh:mm:ss', '1977-Jun-13 02:15:45')
        when:
            def result = gigasecond.from(start)
        then:
            result == Date.parse('yyyy-MMM-dd hh:mm:ss', '2009-Feb-19 04:02:25')
    }

}

Version data entries

101 entries across 101 versions & 1 rubygems

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