@@ -39,6 +39,8 @@ public void behaviorDefaultConfig() throws Exception {
39
39
.testResource ("scala/scalafmt/basic.dirty" , "scala/scalafmt/basic.clean_1.1.0" );
40
40
StepHarness .forStep (ScalaFmtStep .create ("2.0.1" , TestProvisioner .mavenCentral (), null ))
41
41
.testResource ("scala/scalafmt/basic.dirty" , "scala/scalafmt/basic.clean_2.0.1" );
42
+ StepHarness .forStep (ScalaFmtStep .create ("3.0.0" , TestProvisioner .mavenCentral (), null ))
43
+ .testResource ("scala/scalafmt/basic.dirty" , "scala/scalafmt/basic.clean_3.0.0" );
42
44
}
43
45
44
46
@ Test
@@ -47,6 +49,8 @@ public void behaviorCustomConfig() throws Exception {
47
49
.testResource ("scala/scalafmt/basic.dirty" , "scala/scalafmt/basic.cleanWithCustomConf_1.1.0" );
48
50
StepHarness .forStep (ScalaFmtStep .create ("2.0.1" , TestProvisioner .mavenCentral (), createTestFile ("scala/scalafmt/scalafmt.conf" )))
49
51
.testResource ("scala/scalafmt/basic.dirty" , "scala/scalafmt/basic.cleanWithCustomConf_2.0.1" );
52
+ StepHarness .forStep (ScalaFmtStep .create ("3.0.0" , TestProvisioner .mavenCentral (), createTestFile ("scala/scalafmt/scalafmt.conf" )))
53
+ .testResource ("scala/scalafmt/basic.dirty" , "scala/scalafmt/basic.cleanWithCustomConf_3.0.0" );
50
54
}
51
55
52
56
@ Test
@@ -63,6 +67,20 @@ public void behaviorCustomConfigVersion_2_0_0() throws Exception {
63
67
.testResource ("scala/scalafmt/basic.dirty" , "scala/scalafmt/basicPost2.0.0.cleanWithCustomConf" );
64
68
}
65
69
70
+ @ Test
71
+ public void behaviorDefaultConfigVersion_3_0_0 () throws Exception {
72
+ FormatterStep step = ScalaFmtStep .create ("3.0.0" , TestProvisioner .mavenCentral (), null );
73
+ StepHarness .forStep (step )
74
+ .testResource ("scala/scalafmt/basic.dirty" , "scala/scalafmt/basicPost3.0.0.clean" );
75
+ }
76
+
77
+ @ Test
78
+ public void behaviorCustomConfigVersion_3_0_0 () throws Exception {
79
+ FormatterStep step = ScalaFmtStep .create ("3.0.0" , TestProvisioner .mavenCentral (), createTestFile ("scala/scalafmt/scalafmt.conf" ));
80
+ StepHarness .forStep (step )
81
+ .testResource ("scala/scalafmt/basic.dirty" , "scala/scalafmt/basicPost3.0.0.cleanWithCustomConf" );
82
+ }
83
+
66
84
@ Test
67
85
public void equality () throws Exception {
68
86
new SerializableEqualityTester () {
@@ -106,5 +124,9 @@ public void invalidConfiguration() throws Exception {
106
124
exception = assertThrows (InvocationTargetException .class ,
107
125
() -> StepHarness .forStep (ScalaFmtStep .create ("2.0.1" , provisioner , invalidConfFile )).test ("" , "" ));
108
126
assertThat (exception .getTargetException ().getMessage (), containsString ("Invalid field: invalidScalaFmtConfigField" ));
127
+
128
+ exception = assertThrows (InvocationTargetException .class ,
129
+ () -> StepHarness .forStep (ScalaFmtStep .create ("3.0.0" , provisioner , invalidConfFile )).test ("" , "" ));
130
+ assertThat (exception .getTargetException ().getMessage (), containsString ("found option 'invalidScalaFmtConfigField' which wasn't expected" ));
109
131
}
110
132
}
0 commit comments