Skip to content

Commit 05fe1fe

Browse files
committed
test: update tests
1 parent 5508a34 commit 05fe1fe

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

testlib/src/test/java/com/diffplug/spotless/scala/ScalaFmtStepTest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2024 DiffPlug
2+
* Copyright 2016-2025 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -48,17 +48,18 @@ void behaviorFileOverride() {
4848
}
4949

5050
@Test
51-
void behaviorDefaultConfigVersion_3_0_0() {
51+
void behaviorNoConfigFile() {
5252
FormatterStep step = ScalaFmtStep.create("3.0.0", TestProvisioner.mavenCentral(), null);
5353
StepHarness.forStep(step)
5454
.testResource("scala/scalafmt/basic.dirty", "scala/scalafmt/basicPost3.0.0.clean");
5555
}
5656

5757
@Test
58-
void behaviorCustomConfigVersion_3_0_0() {
58+
void behaviorConfigFileVersionDoesnotMatchLibrary() {
5959
FormatterStep step = ScalaFmtStep.create("3.0.0", TestProvisioner.mavenCentral(), createTestFile("scala/scalafmt/scalafmt.conf"));
60-
StepHarness.forStep(step)
61-
.testResource("scala/scalafmt/basic.dirty", "scala/scalafmt/basicPost3.0.0.cleanWithCustomConf");
60+
Assertions.assertThatThrownBy(() -> {
61+
step.format("", new File(""));
62+
}).cause().message().contains("Spotless is using 3.0.0 but the config file declares 3.8.1. Both must match. Update the version declared in the plugin's settings and/or the config file.");
6263
}
6364

6465
@Test

0 commit comments

Comments
 (0)