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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pactfile_write_mode - "usage" text is missing the option to 'update' #112

Closed
andreasmarkussen opened this issue Sep 8, 2019 · 2 comments

Comments

@andreasmarkussen
Copy link

andreasmarkussen commented Sep 8, 2019

Though this is minor, it still is something that could give issues for newbies like me.

When reading the source code of interactions/interactions_filter.rb the pactfile_write_mode has 3 options, but when reading the "Options:" description and the Readme.md documentation that refers to the options documentation, then only two are described.

The 3 options from the source code are

# When running in pactfile_write_mode :overwrite, all interactions are cleared from the
# pact file, and all new interactions should be distinct (unique description and provider state).
# When running in pactfile_write_mode :update, an interaction with the same description
# and provider state as an existing one will just overwrite that one interaction.
# When running in pactfile_write_mode :merge, an interaction with the same description and provider
# state must be identical to the existing one, otherwise an exception will be raised.

The content from the "Usage:" section is (newlines added for readability)

PACT_FILE_WRITE_MODE_DESC = "`overwrite` or `merge`. 
        Use `merge` when running multiple mock service instances in parallel
        for the same consumer/provider pair." 
+   " Ensure the pact file is deleted before running tests when using 
        this option so that interactions deleted from the code are not maintained in the file."

(yes and code are should be code is ... at least according to Grammarly)

I am not strong enough in either Ruby or the real meaning of the Write Mode to suggest what it really should be and just to the PR, however, inputs to a better "Usage:" are welcome, and then I could perhaps update at least the readme and the usage.

@bethesque
Copy link
Member

The update option was only really added as an internal hack because we had a long running pact test suite and I didn't want to run the whole thing each time, so I added an update option, never really intending it to be public. Are you using it?

@bethesque
Copy link
Member

Closing due to inactivity.

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

No branches or pull requests

2 participants