public void artifactsAreNotUpToDateWhenOutputDirWhichUsedToExistHasBeenDeleted() {
// Output dir already exists before first execution of task
outputDirFile.createFile();
expectEmptyCacheLocated();
TaskInternal task1 = builder().withOutputFiles(outputDir).createsFiles(outputDirFile).task();
TaskInternal task2 = builder().withPath("other").withOutputFiles(outputDir).createsFiles(outputDirFile2).task();
TaskArtifactState state = repository.getStateFor(task1);
assertFalse(state.isUpToDate());
state.update();
outputDir.deleteDir();
// Another task creates dir
state = repository.getStateFor(task2);
assertFalse(state.isUpToDate());
task2.execute();
state.update();
// Task should be out-of-date
state = repository.getStateFor(task1);
assertFalse(state.isUpToDate());