コード例 #1
0
  @Test
  public void shouldWriteToOutputFileWhenNotUsingOutputDirAndIsSet() {
    when(mojo.getOutputFile()).thenReturn(OUTPUT_FILE);

    String output = builder.buildFrom(INPUT_FILE, mojo);
    assertThat(output, equalTo(fileUtils.createFullPath(BASE_DIR, OUTPUT_FILE)));
  }
コード例 #2
0
  @Test
  public void shouldPrefixBasedirWhenNotUsingOutputBasedir() {
    when(mojo.getOutputDir()).thenReturn(OUTPUT_DIR);

    String output = builder.buildFrom(INPUT_FILE, mojo);
    assertThat(output, equalTo(fileUtils.createFullPath(BASE_DIR, OUTPUT_DIR, "input")));
  }
コード例 #3
0
  @Test
  public void shouldPreservePathWhenPreserveIsEnabled() {
    when(mojo.isPreserveDir()).thenReturn(true);
    when(mojo.getOutputDir()).thenReturn(OUTPUT_DIR);

    String output = builder.buildFrom(INPUT_FILE, mojo);
    assertThat(output, equalTo(fileUtils.createFullPath(BASE_DIR, OUTPUT_DIR, INPUT_FILE)));
  }
コード例 #4
0
 @Test
 public void shouldReturnInputFileWithBaseDirWhenNoOutputDirOrNoOutputFile() {
   String output = builder.buildFrom(INPUT_FILE, mojo);
   assertThat(output, equalTo(fileUtils.createFullPath(BASE_DIR, INPUT_FILE)));
 }