use of org.gradle.api.internal.file.FileCollectionInternal in project gradle by gradle.
the class DefaultConfigurableFileCollectionTest method canUseAFileCollectionToSpecifyTheContentsOfTheCollection.
@Test
public void canUseAFileCollectionToSpecifyTheContentsOfTheCollection() {
final File file1 = new File("1");
final File file2 = new File("2");
final FileCollectionInternal src = context.mock(FileCollectionInternal.class);
collection.from(src);
context.checking(new Expectations() {
{
oneOf(src).getFiles();
will(returnValue(toLinkedSet(file1)));
}
});
assertThat(collection.getFiles(), equalTo(toLinkedSet(file1)));
context.checking(new Expectations() {
{
oneOf(src).getFiles();
will(returnValue(toLinkedSet(file1, file2)));
}
});
assertThat(collection.getFiles(), equalTo(toLinkedSet(file1, file2)));
}
Aggregations