package de.gesellix.docker.client.config

import spock.lang.Specification
import spock.lang.Unroll

class DockerVersionSpec extends Specification {

    @Unroll
    def "parse version #versionString"() {
        expect:
        DockerVersion.parseDockerVersion(versionString) == version
        where:
        versionString | version
        "1.12.0"      | new DockerVersion(major: 1, minor: 12, patch: 0, meta: "")
        "1.12.0-rc2"  | new DockerVersion(major: 1, minor: 12, patch: 0, meta: "-rc2")
    }
}

package de.gesellix.docker.client.config

import spock.lang.Specification
import spock.lang.Unroll

class DockerVersionSpec extends Specification {

    @Unroll
    def "parse version #versionString"() {
        expect:
        DockerVersion.parseDockerVersion(versionString) == version
        where:
        versionString    | version
        "1.12.0"         | new DockerVersion(major: 1, minor: 12, patch: 0, meta: "")
        "1.12.0-rc2"     | new DockerVersion(major: 1, minor: 12, patch: 0, meta: "-rc2")
        "17.03.0-ce-rc1" | new DockerVersion(major: 17, minor: 3, patch: 0, meta: "-ce-rc1")
    }
}

Verify compatibility with new versioning scheme.
Verify compatibility with new versioning scheme.

See https://github.com/docker/docker/pull/31075 for details.
