Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Fix swagger example stubbing #175

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fix swagger example stubbing #175

wants to merge 3 commits into from

Conversation

fishermand46
Copy link
Contributor

I was getting a few errors when trying to stub requests against a swagger contract that had examples.

First off, the Swagger::ResponseClause did not have a to_hash method defined, so it was throwing an error here.

Secondly, the Webmock was complaining because the stubbed response body was being set to a Swagger::V2::Example object, instead of a string. I fixed this by calling parse on the example object before setting it in the response hash.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 2bd52fb on fishermand46:fix_pacto_example_stubbing into * on thoughtworks:master*.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants