Skip to content

Commit

Permalink
Fix test.
Browse files Browse the repository at this point in the history
  • Loading branch information
nedtwigg committed Aug 23, 2022
1 parent a75877c commit e9d3150
Showing 1 changed file with 3 additions and 5 deletions.
Expand Up @@ -20,7 +20,7 @@

import java.io.File;
import java.io.IOException;
import java.util.NoSuchElementException;
import java.lang.reflect.InvocationTargetException;

import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -91,10 +91,8 @@ void invalidConfiguration() throws Exception {
File invalidConfFile = createTestFile("scala/scalafmt/scalafmt.invalid.conf");
Provisioner provisioner = TestProvisioner.mavenCentral();

NoSuchElementException exception;

exception = assertThrows(NoSuchElementException.class,
InvocationTargetException exception = assertThrows(InvocationTargetException.class,
() -> StepHarness.forStep(ScalaFmtStep.create("3.0.0", provisioner, invalidConfFile)).test("", ""));
assertThat(exception.getMessage()).contains("found option 'invalidScalaFmtConfigField' which wasn't expected");
assertThat(exception.getCause().getMessage()).contains("found option 'invalidScalaFmtConfigField' which wasn't expected");
}
}

0 comments on commit e9d3150

Please sign in to comment.