Repository navigation
Conversation
Combined matchers now serialise inline, like every other matcher:
{"pact:matcher:type":[<each matcher without its value>],
"pact:matcher:combine":"OR"|"AND","value":<sample>}
This needs a pact_ffi with `pact:matcher:combine` support
(pact-foundation/pact-reference#601), which writes the usual
`{"combine":"OR","matchers":[...]}` rule list to the pact file.
- Combined is now a Pact::Matchers::Base, so it is serialised wherever
matchers are (request/response bodies, headers, query, message
contents) and can be nested in a hash/array or inside another
matcher's sample.
- Matchers nested in an object sample keep their own rules, so
null-or-object works.
- Drop the separate PactFfi.with_matching_rules call, the path tracking
in InteractionContents and Base#as_matching_rule.
- A Combined cannot be an alternative of another Combined, and is
rejected in plugin (matching(...)) contents.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ches HttpInteractionBuilder#execute raised InteractionMismatchesError before cleaning up, so the mock server kept its port and the pact handle was not reset; the next interaction on the same port then failed with "Address already in use". It also raised NoMethodError, hiding the real error, when the mock server failed to start. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he mock server Proves each alternative matches, a value matching none fails, nested rules in a null-or-object sample still apply, and the written pact contains `"combine": "OR"` rule lists. Uses a separate consumer name and a temp pact dir so the provider verification does not replay it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…evert before merge) CI clones the YOU54F/pact-ruby-ffi PR branch, whose download script fetches the rc, and points pact-ffi at it with DEBUG_TARGET. The pact-ffi gem cannot come from git: its native libraries are not committed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on pact-foundation/pact-ruby#420 (this PR's base,
base/pr-420-or-composite-matcher, is that PR's head).match_or/match_andare emitted as pact_ffi integration JSON with"pact:matcher:combine". Previously pact-ruby resolved them itself, so the FFI path now handles them.match_nulland*_or_nilhelpers, with docs in the README.http_client_spec.rb).Testing
http_client_spec(7 examples) and the matcher specs passed locally against a pact_ffi build with #601. The port 9001 failures elsewhere are pre-existing.Depends on
pact:matcher:combineORin integration JSON pact-foundation/pact-reference#601 (pact:matcher:combinein integration JSON), with the follow-ups in fix(matching): support rules combined with OR in the V2 matching engine pact-reference#28 (V2 matching engine), Adding model factories detailed documentation pact-foundation/pact-ruby#29 (FFI) and Running pact with existing contact pact-foundation/pact-ruby#30 (compatibility suite).pact_ffi0.5.13-or.1 prerelease built from those changes on YOU54F/pact-reference.Warning
The last commit (
test: consume pact_ffi 0.5.13-or.1 … (revert before merge)) points this repo at the fork prerelease so CI can test it end to end. Revert it and bump to the released pact_ffi before merging upstream.CI: the pin commit installs pact_ffi 0.5.13-or.1 via YOU54F/pact-ruby-ffi
feat/or-matcherand fails unless that version is loaded.🤖 Generated with Claude Code