Module: Pact::FileName

Included in:
ConsumerContract, Provider::VerificationReport
Defined in:
lib/pact/consumer_contract/consumer_contract.rb

Overview

TODO move to external file for reuse

Instance Method Summary collapse

Instance Method Details

#file_name(consumer_name, provider_name) ⇒ Object



41
42
43
# File 'lib/pact/consumer_contract/consumer_contract.rb', line 41

def file_name consumer_name, provider_name
  "#{filenamify(consumer_name)}-#{filenamify(provider_name)}.json"
end

#filenamify(name) ⇒ Object



45
46
47
# File 'lib/pact/consumer_contract/consumer_contract.rb', line 45

def filenamify name
  name.downcase.gsub(/\s/, '_')
end