@Test
public void testDeleteExistingDirectoryAsFileError() throws Exception {

  // Prepare
  AdbFileOperations fileOperations = setupMockDevice();
  // Act/Assert
  thrown.expect(ExecutionException.class);
  thrown.expectCause(IsInstanceOf.instanceOf(AdbShellCommandException.class));
  waitForFuture(fileOperations.deleteFile("/sdcard/foo-dir"));
}