pact-foundation / pact-ruby

Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.
https://pact.io
MIT License
2.17k stars 215 forks source link

Change provider_state to providerState #42

Closed bethesque closed 7 years ago

bethesque commented 10 years ago

https://github.com/bethesque/pact-specification/issues/9

uglyog commented 8 years ago

Is this still an issue? I want to close off the corresponding issue in the specification project.

sergei-matheson commented 8 years ago

Yeah, it is. I'll put a fix in for it this week. For now, I'll set both provider_state, and providerState, and check for providerState first on the provider side. That way it should handle the transition gracefully.

bethesque commented 8 years ago

It already does when reading

 @provider_state = attributes[:provider_state] || attributes[:providerState]

https://github.com/bethesque/pact-support/blob/master/lib/pact/consumer_contract/interaction.rb#L18

mefellows commented 7 years ago

FYI we now have two downstream issues logged at https://github.com/pact-foundation/pact-go/issues/16 and https://github.com/pact-foundation/pact-js/issues/34 (they both use this under the hood to generate contracts)

bethesque commented 7 years ago

Yeah, go needs to use providerState. The underscored one is way way outdated. Is there some code somewhere that is being copied that is propagating this misunderstanding? All the pact specs should be using providerState.

mefellows commented 7 years ago

I can update JS/Go to send provider state in (via the HTTP interface) as providerState, the probably I'm seeing is that when we use the Mock Service (which I think uses this Gem to do it), it generates a pact file with provider_state - is this the right place to track the issue?

bethesque commented 7 years ago

It's actually in the mock service code, but we already have enough issues, let's leave this here!

bethesque commented 7 years ago

Done. https://github.com/pact-foundation/pact-mock_service/commit/6ae77686c1595a405322ba0c6b894500c7081f55

[Hides head in shame]