Skip to content

Commit 0561131

Browse files
Copilotgaeljw
andcommitted
Run scalafmtAll to format code according to project standards
Co-authored-by: gaeljw <18280708+gaeljw@users.noreply.github.com>
1 parent c53e08e commit 0561131

File tree

10 files changed

+33
-29
lines changed

10 files changed

+33
-29
lines changed

cucumber-scalatest/src/main/scala/io/cucumber/scalatest/CucumberSuite.scala

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package io.cucumber.scalatest
22

3-
import io.cucumber.core.options.{RuntimeOptionsBuilder, CucumberOptionsAnnotationParser}
3+
import io.cucumber.core.options.{
4+
RuntimeOptionsBuilder,
5+
CucumberOptionsAnnotationParser
6+
}
47
import io.cucumber.core.runtime.{Runtime => CucumberRuntime}
58
import org.scalatest.{Args, Status, Suite}
69

@@ -29,11 +32,14 @@ trait CucumberSuite extends Suite {
2932

3033
/** Runs the Cucumber scenarios.
3134
*
32-
* @param testName An optional name of one test to run. If None, all relevant
33-
* tests should be run.
34-
* @param args the Args for this run
35-
* @return a Status object that indicates when all tests started by this method
36-
* have completed, and whether or not a failure occurred.
35+
* @param testName
36+
* An optional name of one test to run. If None, all relevant tests should
37+
* be run.
38+
* @param args
39+
* the Args for this run
40+
* @return
41+
* a Status object that indicates when all tests started by this method
42+
* have completed, and whether or not a failure occurred.
3743
*/
3844
abstract override def run(
3945
testName: Option[String],
@@ -47,7 +53,7 @@ trait CucumberSuite extends Suite {
4753

4854
val runtimeOptions = buildRuntimeOptions()
4955
val classLoader = getClass.getClassLoader
50-
56+
5157
val runtime = CucumberRuntime
5258
.builder()
5359
.withRuntimeOptions(runtimeOptions)
@@ -57,12 +63,14 @@ trait CucumberSuite extends Suite {
5763
.build()
5864

5965
runtime.run()
60-
66+
6167
val exitStatus = runtime.exitStatus()
6268
if (exitStatus == 0) {
6369
org.scalatest.SucceededStatus
6470
} else {
65-
throw new RuntimeException(s"Cucumber scenarios failed with exit status: $exitStatus")
71+
throw new RuntimeException(
72+
s"Cucumber scenarios failed with exit status: $exitStatus"
73+
)
6674
}
6775
}
6876

@@ -71,15 +79,17 @@ trait CucumberSuite extends Suite {
7179
val annotationParser = new CucumberOptionsAnnotationParser()
7280
val packageName = getClass.getPackage.getName
7381
val featurePath = "classpath:" + packageName.replace('.', '/')
74-
82+
7583
try {
7684
val annotationOptions = annotationParser.parse(getClass).build()
7785
val options = new RuntimeOptionsBuilder().build(annotationOptions)
78-
86+
7987
// If no features were specified, use convention (classpath:package/name)
8088
if (options.getFeaturePaths().isEmpty) {
8189
val builder = new RuntimeOptionsBuilder()
82-
builder.addFeature(io.cucumber.core.feature.FeatureWithLines.parse(featurePath))
90+
builder.addFeature(
91+
io.cucumber.core.feature.FeatureWithLines.parse(featurePath)
92+
)
8393
builder.addGlue(java.net.URI.create("classpath:" + packageName))
8494
builder.build(annotationOptions)
8595
} else {
@@ -89,7 +99,9 @@ trait CucumberSuite extends Suite {
8999
case _: Exception =>
90100
// If that fails, use convention based on package name
91101
val builder = new RuntimeOptionsBuilder()
92-
builder.addFeature(io.cucumber.core.feature.FeatureWithLines.parse(featurePath))
102+
builder.addFeature(
103+
io.cucumber.core.feature.FeatureWithLines.parse(featurePath)
104+
)
93105
builder.addGlue(java.net.URI.create("classpath:" + packageName))
94106
builder.build()
95107
}

examples/examples-scalatest/src/test/scala/cucumber/examples/scalacalculator/RpnCalculatorStepDefinitions.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ class RpnCalculatorStepDefinitions extends ScalaDsl with EN {
1313
}
1414

1515
Then("the result is {double}") { (expected: Double) =>
16-
assert(math.abs(expected - calc.value) < 0.001, s"Expected $expected but got ${calc.value}")
16+
assert(
17+
math.abs(expected - calc.value) < 0.001,
18+
s"Expected $expected but got ${calc.value}"
19+
)
1720
}
1821

1922
Before("not @foo") { (scenario: Scenario) =>

integration-tests/scalatest/src/test/scala/cukes/RunCukesTest.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ import io.cucumber.scalatest.{CucumberOptions, CucumberSuite}
66
plugin = Array("pretty")
77
)
88
class RunCukesTest extends CucumberSuite
9-

integration-tests/scalatest/src/test/scala/datatables/RunDatatablesTest.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ package datatables
22

33
import io.cucumber.scalatest.{CucumberOptions, CucumberSuite}
44

5-
65
@CucumberOptions(
76
glue = Array("datatables"),
87
features = Array("classpath:datatables"),
98
plugin = Array("pretty")
109
)
1110
class RunDatatablesTest extends CucumberSuite
12-

integration-tests/scalatest/src/test/scala/docstring/RunDocStringTest.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ package docstring
22

33
import io.cucumber.scalatest.{CucumberOptions, CucumberSuite}
44

5-
65
@CucumberOptions(
76
glue = Array("docstring"),
87
features = Array("classpath:docstring"),
98
plugin = Array("pretty")
109
)
1110
class RunDocStringTest extends CucumberSuite
12-

integration-tests/scalatest/src/test/scala/isolated/RunIsolatedTest.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ package isolated
22

33
import io.cucumber.scalatest.{CucumberOptions, CucumberSuite}
44

5-
65
@CucumberOptions(
76
glue = Array("isolated"),
87
features = Array("classpath:isolated"),
98
plugin = Array("pretty")
109
)
1110
class RunIsolatedTest extends CucumberSuite
12-

integration-tests/scalatest/src/test/scala/misc/RunMiscTest.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ package misc
22

33
import io.cucumber.scalatest.{CucumberOptions, CucumberSuite}
44

5-
65
@CucumberOptions(
76
glue = Array("misc"),
87
features = Array("classpath:misc"),
98
plugin = Array("pretty")
109
)
1110
class RunMiscTest extends CucumberSuite
12-

integration-tests/scalatest/src/test/scala/object/RunObjectTest.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ package `object`
22

33
import io.cucumber.scalatest.{CucumberOptions, CucumberSuite}
44

5-
65
@CucumberOptions(
76
glue = Array("object"),
87
features = Array("classpath:object"),
98
plugin = Array("pretty")
109
)
1110
class RunObjectTest extends CucumberSuite
12-

integration-tests/scalatest/src/test/scala/parametertypes/RunParameterTypesTest.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ package parametertypes
22

33
import io.cucumber.scalatest.{CucumberOptions, CucumberSuite}
44

5-
65
@CucumberOptions(
76
glue = Array("parametertypes"),
87
features = Array("classpath:parametertypes"),
98
plugin = Array("pretty")
109
)
1110
class RunParameterTypesTest extends CucumberSuite
12-

integration-tests/scalatest/src/test/scala/statichooks/RunStaticHooksTest.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import org.scalatest.{BeforeAndAfterAll, Assertions}
99
features = Array("classpath:statichooks"),
1010
plugin = Array("pretty")
1111
)
12-
class RunStaticHooksTest extends CucumberSuite with BeforeAndAfterAll with Assertions {
12+
class RunStaticHooksTest
13+
extends CucumberSuite
14+
with BeforeAndAfterAll
15+
with Assertions {
1316

1417
override def beforeAll(): Unit = {
1518
super.beforeAll()
@@ -30,4 +33,3 @@ class RunStaticHooksTest extends CucumberSuite with BeforeAndAfterAll with Asser
3033
}
3134

3235
}
33-

0 commit comments

Comments
 (0)