@Test
public void postInsertForValidTripButIOFails() throws Exception {

    final DatabaseOperationMetadata metadata = new DatabaseOperationMetadata(OperationFamilyType.Rollback);
    final String name = "name";
    when(mTrip1.getName()).thenReturn(name);
    when(mStorageManager.mkdir(name)).thenReturn(null);
    when(mTripsTable.delete(mTrip1, metadata)).thenReturn(Single.just(mTrip1));
    mTripTableActionAlterations.postInsert(mTrip1)
            .test()
            .assertNoValues()
            .assertNotComplete()
            .assertError(IOException.class);
    verify(mTripsTable).delete(mTrip1, metadata);
}