Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pact V4 Tracking Issue #319

Open
YOU54F opened this issue Aug 12, 2024 · 0 comments
Open

Pact V4 Tracking Issue #319

YOU54F opened this issue Aug 12, 2024 · 0 comments

Comments

@YOU54F
Copy link
Member

YOU54F commented Aug 12, 2024

We would like to implement Pact V3 Specification support for Pact Ruby

Current status

  • ⚠️ Unimplemented

Required V4 Features

  • Generators
  • Matchers
  • Multiple interaction types
    • Synchronous/HTTP
    • Synchronous/Message (not currently available in pact-message-ruby)
    • Asynchronous/Message
  • Pact Plugin support

Implementation notes

  • Strong consideration should be made for incorporating pact_ffi functionality (see Pact FFI Tracking Issue #317) rather than re-implementing in ruby

Validation

V4 Related Issues

Will be tagging and closing related v3/v4 issues, and linking to this meta issue

V4 Matchers

matcher Spec Version example configuration description
ArrayContains V4 { "match": "arrayContains", "variants": [...] } Checks if all the variants are present in an array.
StatusCode V4 { "match": "statusCode", "status": "success" } Matches the response status code.
NotEmpty V4 { "match": "notEmpty" } Value must be present and not empty (not null or the empty string)
Semver V4 { "match": "semver" } Value must be valid based on the semver specification
EachKey V4 { "match": "eachKey", "rules": [{"match": "regex", "regex": "\\$(\\.\\w+)+"}], "value": "$.test.one" } Allows defining matching rules to apply to the keys in a map
EachValue V4 { "match": "eachValue", "rules": [{"match": "regex", "regex": "\\$(\\.\\w+)+"}], "value": "$.test.one" } Allows defining matching rules to apply to the values in a collection. For maps, delgates to the Values matcher.

V4 Generators

matcher Spec Version example configuration description
ProviderState V4 {"expression": "/api/user/${id}", type": "ProviderState"} Generates a value that is looked up from the provider state context using the given expression
MockServerURL V4 {"regex": ".*\\/(orders\\/\\d+)$", "example": "http://localhost:1234/orders/5678", type": "MockServerURL"} Generates a URL with the mock server as the base URL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant