Sha256: ccb407633918459caa1eee13b3367e32553ed8d02fee7bc797389c3e5358159f

Contents?: true

Size: 1.12 KB

Versions: 1

Compression:

Stored size: 1.12 KB

Contents

require 'thor'
require 'pact/consumer/configuration'

module Pact
  class CLI < Thor

    desc 'verify', "Verify a pact"
    method_option :pact_helper, aliases: "-h", desc: "Pact helper file", :required => true
    method_option :pact_uri, aliases: "-p", desc: "Pact URI"
    method_option :backtrace, aliases: "-b", desc: "Show full backtrace", :default => false, :type => :boolean
    method_option :description, aliases: "-d", desc: "Interaction description filter"
    method_option :provider_state, aliases: "-s", desc: "Provider state filter"

    def verify
      require 'pact/cli/run_pact_verification'
      Cli::RunPactVerification.call(options)
    end

    desc 'docs', "Generate Pact documentation in markdown"
    method_option :pact_dir, desc: "Directory containing the pacts", default: Pact.configuration.pact_dir
    method_option :doc_dir, desc: "Documentation directory", default: Pact.configuration.doc_dir

    def docs
      require 'pact/cli/generate_pact_docs'
      require 'pact/doc/generator'
      Pact::Doc::Generate.call(options[:pact_dir], options[:doc_dir], [Pact::Doc::Markdown::Generator])
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pact-1.6.0 lib/pact/cli.rb