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.78 tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy