use of com.facebook.buck.testutil.AllExistingProjectFilesystem in project buck by facebook.
the class DefaultJavaLibraryTest method testJavaLibaryThrowsIfResourceIsDirectory.
@Test
public void testJavaLibaryThrowsIfResourceIsDirectory() throws Exception {
ProjectFilesystem filesystem = new AllExistingProjectFilesystem() {
@Override
public boolean isDirectory(Path path, LinkOption... linkOptionsk) {
return true;
}
};
try {
JavaLibraryBuilder.createBuilder(BuildTargetFactory.newInstance("//library:code")).addResource(new FakeSourcePath("library")).build(ruleResolver, filesystem);
fail("An exception should have been thrown because a directory was passed as a resource.");
} catch (HumanReadableException e) {
assertTrue(e.getHumanReadableErrorMessage().contains("a directory is not a valid input"));
}
}
Aggregations