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(*pact_files) ⇒ Object

Raises:

  • (Thor::Error)


37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/pact/stub_service/cli.rb', line 37

def service(*pact_files)
  require 'pact/mock_service/run'
  require 'pact/support/expand_file_list'

  expanded_pact_files = file_list(pact_files)
  raise Thor::Error.new("Please provide at least one pact file to load") if expanded_pact_files.empty?

  opts = Thor::CoreExt::HashWithIndifferentAccess.new
  opts.merge!(options)
  opts[:stub_pactfile_paths] = expanded_pact_files
  opts[:pactfile_write_mode] = 'none'
  MockService::Run.(opts)
end

#versionObject



53
54
55
56
# File 'lib/pact/stub_service/cli.rb', line 53

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