Sha256: 9906d71c98b8cf09af48283efd5a170dab6fe3540c0fef48a82e47086cbf93c5
Contents?: true
Size: 1.39 KB
Versions: 2
Compression:
Stored size: 1.39 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" } ] ] ] 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
2 entries across 2 versions & 1 rubygems