Skip to content
Merged
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
11 changes: 11 additions & 0 deletions common/src/main/scala/org/mockito/matchers/EqMatchers.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package org.mockito
package matchers

import org.mockito.internal.ValueClassExtractor
import org.mockito.{ ArgumentMatchers => JavaMatchers }
import org.scalactic.{ Equality, Prettifier }

import scala.reflect.ClassTag

Expand All @@ -21,4 +23,13 @@ private[mockito] trait EqMatchers {
* Delegates to <code>ArgumentMatchers.refEq()</code>, it's only here so we expose all the `ArgumentMatchers` on a single place
*/
def refEq[T](value: T, excludeFields: String*): T = JavaMatchers.refEq(value, excludeFields: _*)

/**
* Creates a matcher that delegates on {{org.scalactic.Equality}} so you can always customise how the values are compared Also works with value classes
*/
def eqTo[T: Equality: ValueClassExtractor](value: T)(implicit $pt: Prettifier): T = {
JavaMatchers.argThat(new EqTo[T](value))
value
}

}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import org.mockito.matchers._
trait ArgumentMatchersSugar
extends AnyMatchers
with EqMatchers
with EqMatchers_VersionSpecific
with ThatMatchers
with StringThatMatchers
with NullMatchers
Expand Down