<@UELMFD9PG> Hi! I see from: - <https://pact-found...
# pact-ruby
s
@Yousaf Nabi (pactflow.io) Hi! I see from: • Your last message aboveThis Draft PR here • Tracking issues for V3 and V4 ... that we can soon expect support for generators in pact-ruby, am I right? We have implemented multiple Elixir services over to Pact with our pact_erlang fork, and I am now introducing contract testing to the first Ruby service using pact-ruby. I got stuck at Authorization, because for Elixir we used the generators to provide
Bearer ${authToken}
on Consumer side, and then pact verifier would replace it with a real token based on provider state when replaying the request. Was surprised to find that pact-ruby doesn't have it yet, but pleased to see that this has recently picked up attention again. 1. When can we expect those to come into latest version of pact-ruby? 2. Can you recommend a good branch/fork we could use for the time being, so that when the official release comes, we can switch over with minimal friction?
y
Hey dude, Any chance you could provide an example with your pact? Pact ruby does support overriding headers, but doesn't support v3/v4 generators as you've seen from some of the tracking issues. To answer your questions 1. Date undefined. We are seeking maintainers and contributors to help push it along, but I have been tickling it when I get free time, but I am juggling many things 2. I would read my latest blog post where I spotted someone taking advantage of my pact-ruby-ffi wrapper around the pact_ffi libraries and turning it into a usable project. https://docs.pact.io/blog/2024/09/30/pact-open-source-update-sept-2024#sbmt-pact---pact-v3v4--plugin-support It has been built by real Ruby experts rather than myself who has been learning on the fly, and as they have been using it in production, they have solved some of the paradigm shifts in usage from being a ruby library, to a rust library where ruby is a 2nd class citizen and loses some cool ruby features in the process. (like needing a real app spun up) You can test out any of the pact ruby current PR's by cloning the repos, selecting your branches and setting X_PACT_DEVELOPMENT https://github.com/pact-foundation/pact-provider-verifier/blob/b5d4b9f008bd37ad36bee778a8bd7ce4d748b5e1/Gemfile#L7 in order to pickup and test the changes. You can alternatively use the pact verifier cli https://github.com/pact-foundation/pact-reference/tree/master/rust/pact_verifier_cli#standalone-pact-verifier which is language agnostic and just needs a running provider URL which may just solve your issues 👍
s
Pact ruby does support overriding headers, but doesn't support v3/v4 generators
Ooh, overriding headers you say. I shall look into it, as this would achieve the same thing. We started to use the generators for our elixir contract testing, as I had struggled with overriding the request headers there and generators seemed like a good option. Overriding should work just as well. I'll take a look.
y