Skip to content

Commit

Permalink
test: improve the test for SpoonTagger class (#3982)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohitesh-Kumar-Jain committed Jun 11, 2021
1 parent d09b8e4 commit a4d3aaa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/test/java/spoon/processing/ProcessingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package spoon.processing;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import spoon.Launcher;
import spoon.compiler.Environment;
import spoon.reflect.code.CtAssert;
Expand Down Expand Up @@ -86,8 +87,10 @@ public void testRuntimeProcessorManager() {
}

@Test
public void testSpoonTagger() {
public void testSpoonTagger(@TempDir File tempDir) {
// contract: after running SpoonTagger, the file spoon/Spoon.java should exist in the output directory
final Launcher launcher = new Launcher();
launcher.setSourceOutputDirectory(tempDir.getAbsolutePath());
launcher.addProcessor("spoon.processing.SpoonTagger");
launcher.run();
assertTrue(new File(launcher.getModelBuilder().getSourceOutputDirectory() + "/spoon/Spoon.java").exists());
Expand Down

0 comments on commit a4d3aaa

Please sign in to comment.