hi there! I have a question about the pact specifi...
# pact-ruby
b
hi there! I have a question about the pact specification being used in the latest gem. what does this mean for multiple provider states? I am able to get my tests to enter the v3 interaction parser, when attempting multiple provider states, but pact complains with
WARN: Currently only 1 provider state is supported. Ignoring
additionally, despite that warning, both provider states do seem to run. am I missing something obvious?
b
@Britton Sparks I suspect that I updated the behaviour but didn’t update the message.
b
that was my guess, since I was seeing the code for both states run, I just didn’t understand if there was some inference I was missing with the uneven support of writing pacts in v2 and verifying in v3.
I saw also that the metadata for multiple provider states seems to inject the first as
providerState
is that also expected?
b
What do you mean by metadata?
b
the, I guess, rspec object(?) that contains interaction, the request… this:
Copy code
{:block=>
  #<Proc:0x00005592bd328138 /var/lib/bundle/ruby/2.7.0/gems/pact-1.62.0/lib/pact/provider/rspec.rb:170>,
 :description_args=>["has status code 201"],
 :description=>"has status code 201",
 :full_description=>
  "Verifying a pact between patient-ui and onelife Given pediatric patient has relationship with member administrator member administrator for pediatric beneficiaries signs membership_tos with POST /api/v2/patient/administrator/beneficiaries/3598076/tos_signatures.json returns a response which has status code 201",
 :described_class=>nil,
 :file_path=>
  "/var/lib/bundle/ruby/2.7.0/gems/pact-1.62.0/lib/pact/provider/rspec.rb",
 :line_number=>170,
 :location=>
  "/var/lib/bundle/ruby/2.7.0/gems/pact-1.62.0/lib/pact/provider/rspec.rb:170",
 :absolute_file_path=>
  "/var/lib/bundle/ruby/2.7.0/gems/pact-1.62.0/lib/pact/provider/rspec.rb",
 :rerun_file_path=>
  "/var/lib/bundle/ruby/2.7.0/gems/pact-1.62.0/lib/pact/provider/rspec.rb",
 :scoped_id=>"1:1:1:1:1:1",
 :pactfile_uri=>
  #<Pact::Provider::PactURI:0x00005592bdfeb5c8
   @metadata={},
   @options={:token=>nil},
   @uri="spec/service_consumers/patient-ui-onelife.json">,
 :pact_criteria=>
  {:description=>
    /member administrator for pediatric beneficiaries signs membership_tos/,
   :provider_state=>
    /pediatric patient has relationship with member administrator/},
forgive my ignorance, I am relatively new to ruby.
b
Ah, the rspec metadata.
yes, to be backwards compatible, it picks the first state as the single provider state, but the interaction domain object also has an array of provider state objects on it.
b
as I saw! multiple provider states do seem to be working for me, at least in the very tight scenarios I am working with. but other v3 features, like generators, don’t seem to be. unless I’ve gotten something wrong there, which is entirely possible.
b
No, they’re not supported.