Skip to content

Commit

Permalink
Update scalafmt-core to 3.5.8 (#460)
Browse files Browse the repository at this point in the history
  • Loading branch information
ultrasecreth authored Aug 3, 2022
1 parent 42677fb commit 11e91e7
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 18 deletions.
3 changes: 1 addition & 2 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ maxColumn = 180
rewrite.rules = [RedundantBraces, RedundantParens, SortImports]
spaces.inImportCurlyBraces = true
indentOperator.preset = spray
unindentTopLevelOperators = true

version=3.3.3
version=3.5.8

6 changes: 3 additions & 3 deletions cats/src/main/scala/org/mockito/cats/EqToEquality.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class EqToEquality[T: Eq] extends Equality[T] {
override def areEqual(a: T, b: Any): Boolean =
(a == null && b == null) || (
a != null &&
b != null &&
b.getClass == a.getClass &&
a === b.asInstanceOf[T]
b != null &&
b.getClass == a.getClass &&
a === b.asInstanceOf[T]
)
}
10 changes: 5 additions & 5 deletions macro/src/main/scala/org/mockito/VerifyMacro.scala
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,17 @@ private[mockito] trait VerificationMacroTransformer {
q"""
if (_root_.org.mockito.MockitoSugar.mockingDetails($a).isMock) {
${called match {
case q"$_.calledAgain" =>
val calledPattern = show(q"$a.$b")
q"""throw new _root_.org.mockito.exceptions.misusing.NotAMockException(Seq(
case q"$_.calledAgain" =>
val calledPattern = show(q"$a.$b")
q"""throw new _root_.org.mockito.exceptions.misusing.NotAMockException(Seq(
"[" + $calledPattern + "] is not a mock!",
"Example of correct verification:",
" myMock wasNever called",
""
).mkString("\n"))
"""
case _ => transformInvocation(c)(q"$a.$b", order, q"_root_.org.mockito.VerifyMacro.Never")
}}
case _ => transformInvocation(c)(q"$a.$b", order, q"_root_.org.mockito.VerifyMacro.Never")
}}
} else {
${transformMockWasNeverCalled(q"$a.$b", called)}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class ArgCaptorTest extends AnyWordSpec with MockitoSugar with Matchers {

error.getMessage should (
include("Got [it worked again!] instead of [it worked!]") and
include("Also expected 1 more: [it worked again!]")
include("Also expected 1 more: [it worked again!]")
)
}

Expand All @@ -172,7 +172,7 @@ class ArgCaptorTest extends AnyWordSpec with MockitoSugar with Matchers {

error.getMessage should (
include("Got [it worked!] instead of [it worked again!]") and
include("Also got 1 more: [it worked again!]")
include("Also got 1 more: [it worked again!]")
)
}
}
Expand Down
6 changes: 3 additions & 3 deletions scalaz/src/main/scala/org/mockito/scalaz/EqToEquality.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class EqToEquality[T: Equal] extends Equality[T] {
override def areEqual(a: T, b: Any): Boolean =
(a == null && b == null) || (
a != null &&
b != null &&
b.getClass == a.getClass &&
a === b.asInstanceOf[T]
b != null &&
b.getClass == a.getClass &&
a === b.asInstanceOf[T]
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ The Mockito trait is reusable in other contexts

implicit val order = inOrder(list1, list2)
(there was one(list1).get(0) andThen
one(list2).get(0)).message must_== "The mock was called as expected"
one(list2).get(0)).message must_== "The mock was called as expected"
}

def order2 = {
Expand All @@ -543,7 +543,7 @@ The Mockito trait is reusable in other contexts

implicit val order = inOrder(ignoreStubs(list1, list2))
(there was one(list1).get(0) andThen
one(list2).get(0)).message must_== "The mock was called as expected"
one(list2).get(0)).message must_== "The mock was called as expected"
}

def order3 = {
Expand Down Expand Up @@ -586,7 +586,7 @@ The Mockito trait is reusable in other contexts

implicit val order = inOrder(list1, list2)
(there was one(list2).get(0) andThen
one(list1).get(0)).message must startWith("The mock was not called as expected")
one(list1).get(0)).message must startWith("The mock was not called as expected")
}

def order6 = {
Expand Down

0 comments on commit 11e91e7

Please sign in to comment.