Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for datetime expressions #84

Merged
merged 12 commits into from Mar 9, 2022

Conversation

surpher
Copy link
Owner

@surpher surpher commented Mar 5, 2022

馃摑 Summary of Changes

Changes proposed in this pull request:

馃拋 Example

.willRespondWith(
    status: 201,
    body: [
        "start": ExampleGenerator.DateTimeExpression(expression: "@ next hour", format: dateFormat)
    ]
)

馃摑 Notes

  • PactSwift uses pact-rust as the core. When creating the Pact structure that's being passed to the rust core, the actual date value is irrelevant because rust core re-generates it based on the given expression. I've reached out to pact-rust team about thoughts on passing an optional reference date.

馃敤 How To Test

Unit tests have been written.
Create a project where an ExampleGenerator.DateTimeExpression(format: expression: use:) is defined in a request's or response's body.
Run the test and verify the written Pact file contains the datetime generator with an expression.

@surpher surpher added the enhancement New feature or request label Mar 5, 2022
@marcelinoagile
Copy link

marcelinoagile commented Mar 8, 2022

Hi @surpher I created PR #85 with a change which is a nice to have IMHO

@surpher surpher merged commit 6611b13 into main Mar 9, 2022
@surpher surpher deleted the feature/generator/datetime-expression branch March 9, 2022 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants