DeterminedByEquivalence

class DeterminedByEquivalence[T](equivalence: Equivalence[T]) extends Equivalence[T]

This class is part of the Scalactic “explicitly DSL”. Please see the documentation for Explicitly for an overview of the explicitly DSL.

Instances of this class are returned via the decided by <an Equivalence> syntax, and enables afterBeing to be invoked on it. Here's an example, given an Equivalence[String] named myStringEquivalence:

result should equal ("hello") (determined by myStringEquivalence afterBeing lowerCased)
Source:
Explicitly.scala
trait Equivalence[T]
class Object
trait Matchable
class Any

Value members

Concrete methods

This method enables syntax such as the following, given an Equivalence[String] named myStringEquivalence:

This method enables syntax such as the following, given an Equivalence[String] named myStringEquivalence:

result should equal ("hello") (determined by myStringEquivalence afterBeing lowerCased)
                                                                ^
Value parameters:
normalization

A Normalization with which to normalize objects of type T before comparing them for equality using the Equivalence[T] passed to this object's constructor.

Source:
Explicitly.scala
def areEquivalent(a: T, b: T): Boolean

Indicates whether the objects passed as a and b are equal by delegating to the areEquivalent method of the Equivalence[T] passed to this class's constructor.

Indicates whether the objects passed as a and b are equal by delegating to the areEquivalent method of the Equivalence[T] passed to this class's constructor.

Value parameters:
a

a left-hand-side object being compared with another (right-hand-side one) for equality (e.g., a == b)

b

a right-hand-side object being compared with another (left-hand-side one) for equality (e.g., a == b)

Returns:

true if the passed objects are "equal," as defined by this Equality instance

Source:
Explicitly.scala