lib/pact/messages/consumer/world.rb in pact-messages-0.1.1 vs lib/pact/messages/consumer/world.rb in pact-messages-0.2.0

- old
+ new

@@ -16,11 +16,11 @@ module Consumer class World attr_reader :mock_services def initialize - @mock_services = {} + @mock_services = {} end def register_mock_service(mock_service_name, contract_builder) mock_services[mock_service_name] = contract_builder end @@ -31,10 +31,10 @@ def find_contract(provider_name, consumer_name) contract_builder = mock_services.values.find do |builder| builder.provider_name == provider_name && builder.consumer_name == consumer_name end - contract_builder.consumer_contract if contract_builder + contract_builder&.consumer_contract end end end end