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

Path matchers should be implemented without a toFile() conversion #1272

Closed
netvl opened this issue Mar 9, 2020 · 2 comments
Closed

Path matchers should be implemented without a toFile() conversion #1272

netvl opened this issue Mar 9, 2020 · 2 comments
Assignees
Labels
assertions 🔍 Related to the assertion mechanisms within the testing framework. enhancement ✨ Suggestions for adding new features or improving existing ones.
Milestone

Comments

@netvl
Copy link

netvl commented Mar 9, 2020

At the moment, most of the matchers for java.nio.file.Path are implemented using matchers for java.io.File:

fun Path.shouldExist() = this.toFile() should exist()

This, unfortunately, makes these matchers completely unusable with any file system except the default one. For example, if a given Path is obtained from a ZipFileSystem, this matcher will fail with UnsupportedOperationException.

Ideally matchers for Path values should be implemented using native Path operations, for example, checking not path.toFile().exists() but java.nio.file.Files.exists(path).

@sksamuel
Copy link
Member

sksamuel commented Mar 9, 2020

Good points. We'd welcome a PR!

@LeoColman LeoColman added assertions 🔍 Related to the assertion mechanisms within the testing framework. enhancement ✨ Suggestions for adding new features or improving existing ones. labels Mar 10, 2020
@sksamuel sksamuel added this to the 4.0 milestone Mar 15, 2020
@sksamuel sksamuel self-assigned this Mar 15, 2020
@sksamuel
Copy link
Member

Added in beta 3.

@sksamuel sksamuel mentioned this issue Mar 15, 2020
88 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assertions 🔍 Related to the assertion mechanisms within the testing framework. enhancement ✨ Suggestions for adding new features or improving existing ones.
Projects
None yet
Development

No branches or pull requests

3 participants