net.thucydides.core.matchers.FileMatchers Maven / Gradle / Ivy
The newest version!
package net.thucydides.core.matchers;
import org.hamcrest.Description;
import org.hamcrest.Factory;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;
import java.io.File;
public class FileMatchers {
@Factory
public static Matcher exists() {
return new TypeSafeMatcher() {
private File checkedFile;
@Override
public boolean matchesSafely(File file) {
checkedFile = file;
return file.exists();
}
@Override
public void describeTo(Description description) {
description.appendText("a file at " + checkedFile.getPath());
}
};
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy