Sha256: 6256ac12938f60704e33aad0188c17f3a09cec4d3a5ce9b1b2be5fbf2791b4ca

Contents?: true

Size: 1.19 KB

Versions: 2

Compression:

Stored size: 1.19 KB

Contents

require 'pact_broker/client/cli/version_selector_options_parser'

module PactBroker
  module Client
    module CLI
      describe VersionSelectorOptionsParser do

        TEST_CASES = [
          [
            ["--name", "Foo", "--version", "1.2.3"],
            [{ name: "Foo", version: "1.2.3" } ]
          ],[
            ["-n", "Foo", "-a", "1.2.3"],
            [{ name: "Foo", version: "1.2.3" } ]
          ],[
            ["--name", "Foo"],
            [{ name: "Foo" } ]
          ],[
            ["--name", "Foo", "Bar"],
            [{ name: "Bar" } ]
          ],[
            ["--name", "Foo", "--name", "Bar", "--version", "1.2.3"],
            [{ name: "Foo" }, { name: "Bar", version: "1.2.3" } ]
          ],[
            ["--name", "Foo", "--wrong", "Bar", "--version", "1.2.3"],
            [{ name: "Foo", version: "1.2.3" } ]
          ],[
            ["--name", "the-thing", "--version", "1.2.3"],
            [{ name: "the-thing", 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

Version Path
pact_broker-client-1.8.0 spec/lib/pact_broker/client/cli/version_selector_options_parser_spec.rb
pact_broker-client-1.7.0 spec/lib/pact_broker/client/cli/version_selector_options_parser_spec.rb