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

Add VcrStorage abstraction #22

Closed
reibitto opened this issue Apr 11, 2021 · 0 comments · Fixed by #23
Closed

Add VcrStorage abstraction #22

reibitto opened this issue Apr 11, 2021 · 0 comments · Fixed by #23
Labels
good first issue Good for newcomers

Comments

@reibitto
Copy link
Owner

reibitto commented Apr 11, 2021

Right now when creating a VCR client/backend, you have to pass in a file path like:

VcrBackend(
  ...
  recordingPath = Paths.get("vcr/example.json")
)

This isn't great because it assumes you always want to write to a file, but that's too strong of an assumption. We should be able to pass in something like a VcrStorage trait which would have the save() method inside it. So you could pass in FileVcrStorage, InMemoryStorage, and whatever custom implementation a user may want. For example, a user could create an S3VcrStorage if they wanted to (maybe useful for CI environments?).

Also, after this is done, we no longer need to use temporary files in our tests. We could use InMemoryStorage for those.

This is somewhat related to #3. It's at least a prerequisite for it. The choice of format (JSON, YAML, etc.) would also probably go in here (but that would be a separate PR).

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

Successfully merging a pull request may close this issue.

1 participant