Class: Pact::StubService::CLI

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

Instance Method Summary collapse

Methods inherited from MockService::CLI::CustomThor

exit_on_failure?

Instance Method Details

#service(*pact_files) ⇒ Object

Raises:

  • (Thor::Error)


41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/pact/stub_service/cli.rb', line 41

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



57
58
59
60
# File 'lib/pact/stub_service/cli.rb', line 57

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