bow-swift / bow-openapi

🌐 Functional HTTP client generator from an OpenAPI/Swagger specification.
https://openapi.bow-swift.io
Other
52 stars 1 forks source link

Routing and stacking stubbed responses for testing #9

Closed truizlop closed 4 years ago

truizlop commented 4 years ago

This PR lets you stack multiple stubbed responses and route them for a specific endpoint in testing. Besides, some refactor for renaming and duplication removal has been done.

Routing

apiConfig.stub(error: Mother.Error.general, endpoint: "/failing-endpoint")
    .stub(dataRaw: "{}", endpoint: "/test")

Stacking

apiConfig.stub(error: Mother.Error.general, endpoint: "/test")
    .stub(dataRaw: "{}", endpoint: "/test")