Sha256: 1a05a7490d8619c39e5c1406d0bc384152237d101dc064109291681ae4de8383
Contents?: true
Size: 1.73 KB
Versions: 19
Compression:
Stored size: 1.73 KB
Contents
require 'pact_broker/client/cli/version_selector_options_parser' module PactBroker module Client module CLI describe VersionSelectorOptionsParser do TEST_CASES = [ [ ["--pacticipant", "Foo", "--version", "1.2.3"], [{ pacticipant: "Foo", version: "1.2.3" } ] ],[ ["-a", "Foo", "-e", "1.2.3"], [{ pacticipant: "Foo", version: "1.2.3" } ] ],[ ["--pacticipant", "Foo"], [{ pacticipant: "Foo" } ] ],[ ["--pacticipant", "Foo", "Bar"], [{ pacticipant: "Bar" } ] ],[ ["--pacticipant", "Foo", "--pacticipant", "Bar", "--version", "1.2.3"], [{ pacticipant: "Foo" }, { pacticipant: "Bar", version: "1.2.3" } ] ],[ ["--pacticipant", "Foo", "--wrong", "Bar", "--version", "1.2.3"], [{ pacticipant: "Foo", version: "1.2.3" } ] ],[ ["--pacticipant", "the-thing", "--version", "1.2.3"], [{ pacticipant: "the-thing", version: "1.2.3" } ] ],[ ["--version", "1.2.3"], [{ pacticipant: nil, version: "1.2.3" } ] ],[ ["--pacticipant", "Foo", "--latest", "--pacticipant", "Bar"], [{ pacticipant: "Foo", latest: true }, { pacticipant: "Bar" } ] ],[ ["--pacticipant", "Foo", "--latest", "prod", "--pacticipant", "Bar"], [{ pacticipant: "Foo", latest: true, tag: "prod"}, { pacticipant: "Bar" } ] ] ] TEST_CASES.each do | input, output | it "parses #{input.join(' ')}" do expect(VersionSelectorOptionsParser.call(input)).to eq output end end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems