You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.
Here's my proposed API after playing around with some of the ideas on the roadmap. I think this idea will help tie together a lot of the items on the roadmap.
# Simplest possible APIPacto.simulate_consumerdorequest'create something'end# You should probably be able to use Contract objects instead of names, as well:contracts=Pacto.load_contract('my_contracts')Pacto.simulate_consumerdorequestcontracts.firstend# The use of named consumers will help with later reporting and CDC featuresPacto.simulate_consumer:my_consumerdo# Request should accept values for simulationrequest'create something',color: 'blue',size: 'small'request'create something',color: 'blue',size: 'large'end# You should also be able to pass the default values to the consumer, which# will be merged with values on the request. This has the same request as# the block above.Pacto.simulate_consumer:my_consumer,color: 'blue'do# Request should accept values for simulationrequest'create something',size: 'small'request'create something',size: 'large'end# We could add middlware to deal with the "enrichment" items on the roadmapPacto.simulate_consumer:my_consumer,color: 'blue'douseCustomAuthenticationuseRandomHeaderCapitalization# ...end# The consumer should return a set of interactionsinteractions=Pacto.simulate_consumer:my_consumer,color: 'blue'do# Request should accept values for simulationrequest'create something',size: 'small'request'create something',size: 'large'end# We can probably add middleware to handle the "enrichment" items on the roadmap# This will clean up the RSpec API for collaboration testing. Previously we used# expect(Pacto).to ..., now you can do things like:# RSpec 3# expect(interactions).to include(an_interaction_for('create something').with(size: 'large'))# RSpec 2expect(interactions.first).tobe_an_interaction_for('create something').with(size: 'large')# Interactions may also (in the future) have some aggregate methods or advanced capabilities, like:interactions.slowest(5)# returns the 5 slowest HTTP request/response interactionsinteractions.group_by(&:service)# groups by service, in this case 'create something'# auto_cleanup detects interactions that match a "creation pattern" (like a PUT, a# or a POST that returned a 201 (possibly as part of a POST-REDIRECT-GET), and sends# a DELETE request to undo the creation action.interactions.auto_cleanup
The text was updated successfully, but these errors were encountered:
Here's my proposed API after playing around with some of the ideas on the roadmap. I think this idea will help tie together a lot of the items on the roadmap.
The text was updated successfully, but these errors were encountered: