Skip to content

Commit

Permalink
feat: Add test case for getEmbeddingDirectory in ConfigurationTest
Browse files Browse the repository at this point in the history
This commit introduces a new test case to ensure that the getEmbeddingDirectory method in the Configuration class correctly creates the embedding directory path.
  • Loading branch information
harshpreet08 committed Dec 24, 2023
1 parent 83d7aed commit 324e863
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/java/net/masterthought/cucumber/ConfigurationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -457,4 +457,19 @@ public void addCustomJsFiles_addsPropertyFiles() {
List<String> returnedJsFiles = configuration.getCustomJsFiles();
assertThat(returnedJsFiles).containsExactly("custom-code.js");
}

@Test
public void getEmbeddingDirectory_CreatesCorrectDirectoryPath() {
// Arrange
File reportDirectory = new File("target");
Configuration configuration = new Configuration(reportDirectory, "myProject");

String expectedPath = new File(reportDirectory, "cucumber-html-reports" + File.separatorChar + "embeddings").getAbsolutePath();

// Act
File embeddingDirectory = configuration.getEmbeddingDirectory();

// Assert
assertThat(embeddingDirectory.getAbsolutePath()).isEqualTo(expectedPath);
}
}

0 comments on commit 324e863

Please sign in to comment.