@Test
  public void whenRunnerDoesNotExistThenCreateNewRunner() throws Exception {
    String expected = "I'm a new spec runner yay!";
    when(runnerDestination.exists()).thenReturn(false);
    when(specRunnerHtmlGenerator.generateWitRelativePaths()).thenReturn(expected);

    subject.create();

    verify(fileUtilsWrapper).writeStringToFile(runnerDestination, expected, SOURCE_ENCODING);
  }
  @Test
  public void whenRunnerExistsAndDiffersThenWriteNewOne() throws IOException {
    String expected = "HTRML!!!!111!111oneoneone";
    when(runnerDestination.exists()).thenReturn(true);
    when(fileUtilsWrapper.readFileToString(runnerDestination)).thenReturn("old and crusty runner");
    when(specRunnerHtmlGenerator.generateWitRelativePaths()).thenReturn(expected);

    subject.create();

    verify(fileUtilsWrapper).writeStringToFile(runnerDestination, expected, SOURCE_ENCODING);
  }
  @Test
  public void whenExistingRunnerFailsToLoadThenWriteNewOne() throws IOException {
    String expected = "HTRML!!!!111!111oneoneone";
    when(runnerDestination.exists()).thenReturn(true);
    when(fileUtilsWrapper.readFileToString(runnerDestination)).thenThrow(new IOException());
    when(specRunnerHtmlGenerator.generateWitRelativePaths()).thenReturn(expected);

    subject.create();

    verify(fileUtilsWrapper).writeStringToFile(runnerDestination, expected, SOURCE_ENCODING);
    verify(log)
        .warn("An error occurred while trying to open an existing manual spec runner. Continuing.");
  }
  @Test
  public void whenRunnerExistsAndIsSameThenDoNothing() throws IOException {
    String existing = "HTRML!!!!111!111oneoneone";
    when(runnerDestination.exists()).thenReturn(true);
    when(fileUtilsWrapper.readFileToString(runnerDestination)).thenReturn(existing);
    when(specRunnerHtmlGenerator.generateWitRelativePaths()).thenReturn(existing);

    subject.create();

    neverWriteAFile();
    verify(log)
        .info("Skipping spec runner generation, because an identical spec runner already exists.");
  }