Sha256: a1b7e6ba64eb5a69a9eab1c65a8dbfe4790a3ea7302d0a6b265da2deda67d4d5

Contents?: true

Size: 1.17 KB

Versions: 273

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 00: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 01: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 03:02:25')
    }

}

Version data entries

273 entries across 273 versions & 1 rubygems

Version Path
trackler-2.2.1.77 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.76 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.75 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.74 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.73 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.72 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.71 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.70 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.69 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.68 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.67 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.66 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.65 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.64 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.63 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.62 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.61 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.60 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.59 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
trackler-2.2.1.58 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy