Class: Pact::StubService::CLI

Inherits:
MockService::CLI::CustomThor show all
Defined in:
lib/pact/stub_service/cli.rb

Instance Method Summary collapse

Instance Method Details

#service(*pactfiles) ⇒ Object

Raises:

  • (Thor::Error)


34
35
36
37
38
39
40
41
42
43
# File 'lib/pact/stub_service/cli.rb', line 34

def service(*pactfiles)
  raise Thor::Error.new("Please provide an existing pact file to load") if pactfiles.empty?
  require 'pact/mock_service/run'
  options.stub_pactfile_paths = pactfiles
  opts = Thor::CoreExt::HashWithIndifferentAccess.new
  opts.merge!(options)
  opts[:stub_pactfile_paths] = pactfiles
  opts[:pactfile_write_mode] = 'none'
  MockService::Run.(opts)
end

#versionObject



47
48
49
50
# File 'lib/pact/stub_service/cli.rb', line 47

def version
  require 'pact/mock_service/version.rb'
  puts Pact::MockService::VERSION
end