lib/pact/mock_service/app.rb in pact-mock_service-2.6.2 vs lib/pact/mock_service/app.rb in pact-mock_service-2.6.3
- old
+ new
@@ -36,15 +36,15 @@
def shutdown
write_pact_if_configured
end
def setup_stub stub_pactfile_paths
- stub_pactfile_paths.each do | pactfile_path |
+ interactions = stub_pactfile_paths.collect do | pactfile_path |
$stdout.puts "INFO: Loading interactions from #{pactfile_path}"
hash_interactions = JSON.parse(File.read(pactfile_path))['interactions']
- interactions = hash_interactions.collect { | hash | Interaction.from_hash(hash) }
- @session.set_expected_interactions interactions
- end
+ hash_interactions.collect { | hash | Interaction.from_hash(hash) }
+ end.flatten
+ @session.set_expected_interactions interactions
end
def write_pact_if_configured
consumer_contract_writer = ConsumerContractWriter.new(@session.consumer_contract_details, StdoutLogger.new)
if consumer_contract_writer.can_write? && !@session.pact_written?