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

implement time to live #25

Merged
merged 1 commit into from
May 11, 2021
Merged

implement time to live #25

merged 1 commit into from
May 11, 2021

Conversation

pavarnos
Copy link
Contributor

see #24

  • many tests broken because they test implementation details (the contents of the file on disk). Would it make sense to just test behaviour (the CacheInterface)?
  • i copied Filesystem::now() from ArrayCache::now(). If now() was protected, maybe we could make a FakeFilesystem to override now() with a value we control for testing purposes... except that the Filesystem class is final...
  • this change makes existing caches on disk incompatible: so if you release it needs to be a new major version?
  • maybe need a clean() method which would look for all files on disk, read them all, then delete the expired ones

(tests failing)
@WyriHaximus
Copy link
Owner

  • many tests broken because they test implementation details (the contents of the file on disk). Would it make sense to just test behaviour (the CacheInterface)?

Yes, it took me longer to learn this then I'd like to admit but, only test for behaviour and mock as little as possible.

@WyriHaximus WyriHaximus added this to the 1.0.0 milestone May 11, 2021
@WyriHaximus WyriHaximus merged commit d7f0709 into WyriHaximus:master May 11, 2021
@WyriHaximus
Copy link
Owner

Will do a follow up fixing any outstanding issues for this PR, thanks for taking the time to put this together 👍

@WyriHaximus
Copy link
Owner

@pavarnos FYI: #29

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

Successfully merging this pull request may close these issues.

2 participants