Skip to content

Commit 83cef7f

Browse files
Update scalafmt-core to 3.8.6 (#552)
* Update scalafmt-core to 3.8.6 * Reformat with scalafmt 3.8.6 Executed command: scalafmt --non-interactive * Add 'Reformat with scalafmt 3.8.6' to .git-blame-ignore-revs
1 parent 2dc7637 commit 83cef7f

13 files changed

+215
-232
lines changed

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ ff8ca52d610ca63ee0ab4fcfb5d79da13a1250b1
33

44
# Scala Steward: Reformat with scalafmt 3.7.15
55
8fa2251b493a78759fc04a2f74189b9f8bdc07c4
6+
7+
# Scala Steward: Reformat with scalafmt 3.8.6
8+
c038644e07f224e668b7be8c53f9038cfd2275cf

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ rewrite.rules = [RedundantBraces, RedundantParens, SortImports]
77
spaces.inImportCurlyBraces = true
88
indentOperator.preset = spray
99

10-
version=3.8.2
10+
version=3.8.6
1111

common/src/main/scala/org/mockito/ReflectionUtils.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ object ReflectionUtils {
2020

2121
private val mirror = runtimeMirror(getClass.getClassLoader)
2222
private val customMirror = mirror.asInstanceOf[{
23-
def methodToJava(sym: Symbols#MethodSymbol): Method
24-
}
25-
]
23+
def methodToJava(sym: Symbols#MethodSymbol): Method
24+
}]
2625

2726
def listToTuple(l: List[Object]): Any =
2827
l match {

scalatest/src/test/scala/user/org/mockito/IdiomaticStubbingTest.scala

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,8 @@ class IdiomaticStubbingTest extends AnyWordSpec with Matchers with ArgumentMatch
236236

237237
org.doSomethingWithThisIntAndStringAndBoolean(1, "2", v3 = false)
238238

239-
an[IllegalArgumentException] should be thrownBy {
240-
org.doSomethingWithThisIntAndStringAndBoolean(1, "2", v3 = true)
241-
}
239+
an[IllegalArgumentException] should be thrownBy
240+
org.doSomethingWithThisIntAndStringAndBoolean(1, "2", v3 = true)
242241

243242
""""some value" willBe thrown by org.bar""" shouldNot compile
244243
}
@@ -258,9 +257,8 @@ class IdiomaticStubbingTest extends AnyWordSpec with Matchers with ArgumentMatch
258257
aSpy.iBlowUp(1, "ok") shouldBe "mocked!"
259258
aSpy.iBlowUp(2, "ok") shouldBe "mocked!"
260259

261-
an[IllegalArgumentException] should be thrownBy {
262-
aSpy.iBlowUp(2, "not ok")
263-
}
260+
an[IllegalArgumentException] should be thrownBy
261+
aSpy.iBlowUp(2, "not ok")
264262
}
265263

266264
"stub a function with an answer" in {
@@ -316,12 +314,11 @@ class IdiomaticStubbingTest extends AnyWordSpec with Matchers with ArgumentMatch
316314
}
317315

318316
"be thread safe" when {
319-
"always stubbing object methods" in {
320-
immutable.ParSeq.range(1, 100).foreach { i =>
321-
withObjectSpied[FooObject.type] {
322-
FooObject.simpleMethod returns s"spied!-$i"
323-
FooObject.simpleMethod shouldBe s"spied!-$i"
324-
}
317+
"always stubbing object methods" in
318+
immutable.ParSeq.range(1, 100).foreach { i =>
319+
withObjectSpied[FooObject.type] {
320+
FooObject.simpleMethod returns s"spied!-$i"
321+
FooObject.simpleMethod shouldBe s"spied!-$i"
325322
}
326323
}
327324

@@ -357,12 +354,11 @@ class IdiomaticStubbingTest extends AnyWordSpec with Matchers with ArgumentMatch
357354
FooObject.simpleMethod shouldBe "not mocked!"
358355
}
359356

360-
"object stubbing should be thread safe" in {
361-
immutable.ParSeq.range(1, 100).foreach { i =>
362-
withObjectMocked[FooObject.type] {
363-
FooObject.simpleMethod returns s"mocked!-$i"
364-
FooObject.simpleMethod shouldBe s"mocked!-$i"
365-
}
357+
"object stubbing should be thread safe" in
358+
immutable.ParSeq.range(1, 100).foreach { i =>
359+
withObjectMocked[FooObject.type] {
360+
FooObject.simpleMethod returns s"mocked!-$i"
361+
FooObject.simpleMethod shouldBe s"mocked!-$i"
366362
}
367363
}
368364

scalatest/src/test/scala/user/org/mockito/Issue256.scala

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@ class Issue256 extends AnyWordSpec with Matchers {
1313
}
1414

1515
"mockito" should {
16-
"allow stubbing the same method multiple times" in {
17-
MockitoScalaSession().run {
18-
val foo = mock[Foo]
19-
foo.test[String](argThat((s: String) => s.startsWith("foo"))) returns "foo"
20-
foo.test[Int](argThat((n: Int) => n > 10)) returns 42
16+
"allow stubbing the same method multiple times" in
17+
MockitoScalaSession().run {
18+
val foo = mock[Foo]
19+
foo.test[String](argThat((s: String) => s.startsWith("foo"))) returns "foo"
20+
foo.test[Int](argThat((n: Int) => n > 10)) returns 42
2121

22-
foo.test("fooSSS") shouldBe "foo"
23-
foo.test(11) shouldBe 42
24-
}
22+
foo.test("fooSSS") shouldBe "foo"
23+
foo.test(11) shouldBe 42
2524
}
2625
}
2726
}

0 commit comments

Comments
 (0)