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.98 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.97 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.96 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.95 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.94 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.93 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.92 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.91 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.90 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.89 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.88 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.87 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.86 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.85 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.84 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.83 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.82 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.81 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.80 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.79 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy