Skip to content

Drop EqMatchers_VersionSpecific (they aren't specific) #575

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

Merged
merged 1 commit into from
Jul 2, 2025
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