-
Notifications
You must be signed in to change notification settings - Fork 216
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
Support params in provider_state
(v3)
#168
Comments
The provider state params in v3 will help with this, because you'll be able to pass in a hash of arbitrary params to help set up a provider state. eg I'm not sure when I'll get around to implementing that, so if you're interested in doing a PR for your suggestion, I'd be happy to accept it. Personally, I always delegate from the provider state DSL to some helper class anyway, so it ends up being something like: provider_state "an alligator called Tom exists" do
ProviderStateHelper.new.create_alligator("Tom")
end If I'm in a fancy mood, I'll make a fluent DSL so I can do something like: provider_state "an alligator called Tom exists" do
ProviderStateHelper.new
.create_alligator("Tom")
.create_alligator_credit_card("1234123412341234")
.create_address("28 Swamp St")
end |
Oh, you can include modules in the provider states code as well, so it could be as little as provider_state "an alligator called Tom exists" do
create_alligator("Tom")
end |
Thanks. The v3 format looks good and I'll live with the fixed strings for the time being. I hadn't considered using a helper class. I'll have a look at that too. |
provider_state
provider_state
(v3)
closing as tracking under pact v3 epic |
The example on the
README
has a provider state of 'an alligator exists', which can be defined in the provider configuration with:Is there any way to use some form of pattern matching with
provider_state
so that a single block could be used for both 'an alligator called Tom exists' and 'an alligator called Jerry exists'?I'm thinking of something similar to https://github.com/cucumber/cucumber/tree/master/cucumber-expressions
The text was updated successfully, but these errors were encountered: