Skip to content

Update scalafmt-core to 3.8.6 #552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: release/1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ ff8ca52d610ca63ee0ab4fcfb5d79da13a1250b1

# Scala Steward: Reformat with scalafmt 3.7.15
8fa2251b493a78759fc04a2f74189b9f8bdc07c4

# Scala Steward: Reformat with scalafmt 3.8.6
c038644e07f224e668b7be8c53f9038cfd2275cf
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ rewrite.rules = [RedundantBraces, RedundantParens, SortImports]
spaces.inImportCurlyBraces = true
indentOperator.preset = spray

version=3.8.2
version=3.8.6

5 changes: 2 additions & 3 deletions common/src/main/scala/org/mockito/ReflectionUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ object ReflectionUtils {

private val mirror = runtimeMirror(getClass.getClassLoader)
private val customMirror = mirror.asInstanceOf[{
def methodToJava(sym: Symbols#MethodSymbol): Method
}
]
def methodToJava(sym: Symbols#MethodSymbol): Method
}]

def listToTuple(l: List[Object]): Any =
l match {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,8 @@ class IdiomaticStubbingTest extends AnyWordSpec with Matchers with ArgumentMatch

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

an[IllegalArgumentException] should be thrownBy {
org.doSomethingWithThisIntAndStringAndBoolean(1, "2", v3 = true)
}
an[IllegalArgumentException] should be thrownBy
org.doSomethingWithThisIntAndStringAndBoolean(1, "2", v3 = true)

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

an[IllegalArgumentException] should be thrownBy {
aSpy.iBlowUp(2, "not ok")
}
an[IllegalArgumentException] should be thrownBy
aSpy.iBlowUp(2, "not ok")
}

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

"be thread safe" when {
"always stubbing object methods" in {
immutable.ParSeq.range(1, 100).foreach { i =>
withObjectSpied[FooObject.type] {
FooObject.simpleMethod returns s"spied!-$i"
FooObject.simpleMethod shouldBe s"spied!-$i"
}
"always stubbing object methods" in
immutable.ParSeq.range(1, 100).foreach { i =>
withObjectSpied[FooObject.type] {
FooObject.simpleMethod returns s"spied!-$i"
FooObject.simpleMethod shouldBe s"spied!-$i"
}
}

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

"object stubbing should be thread safe" in {
immutable.ParSeq.range(1, 100).foreach { i =>
withObjectMocked[FooObject.type] {
FooObject.simpleMethod returns s"mocked!-$i"
FooObject.simpleMethod shouldBe s"mocked!-$i"
}
"object stubbing should be thread safe" in
immutable.ParSeq.range(1, 100).foreach { i =>
withObjectMocked[FooObject.type] {
FooObject.simpleMethod returns s"mocked!-$i"
FooObject.simpleMethod shouldBe s"mocked!-$i"
}
}

Expand Down
15 changes: 7 additions & 8 deletions scalatest/src/test/scala/user/org/mockito/Issue256.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ class Issue256 extends AnyWordSpec with Matchers {
}

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

foo.test("fooSSS") shouldBe "foo"
foo.test(11) shouldBe 42
}
foo.test("fooSSS") shouldBe "foo"
foo.test(11) shouldBe 42
}
}
}
Loading