File tree 2 files changed +9
-1
lines changed
matcher/shared/src/main/scala/org/specs2/matcher
tests/shared/src/test/scala/org/specs2/matcher
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ class BeFalseMatcher extends Matcher[Boolean]:
176
176
177
177
/** Equality Matcher
178
178
*/
179
- class BeEqualTo [ T ] (t : => T ) extends EqualityMatcher (t)
179
+ class BeEqualTo (t : => Any ) extends EqualityMatcher (t)
180
180
181
181
/** This matcher always matches any value of type T
182
182
*/
Original file line number Diff line number Diff line change @@ -35,6 +35,10 @@ class BeEqualToMatcherSpec extends Spec with ResultMatchers with ShouldMatchers
35
35
${" a" must be_!= (" b" )}
36
36
${" a" must not(be_!= (" a" ))}
37
37
38
+ Distinguish between typed and non typed equality matchers
39
+ ${A must be_== (" a" )}
40
+ Will not compile: {A must not be_===("a")}
41
+
38
42
Array equality uses deep array comparison, with or without typed equality
39
43
${Array (1 , 2 ) must be_== (Array (1 , 2 ))}
40
44
${Array (1 , 2 ) must be_== (Array (1 , 2 ))}
@@ -122,3 +126,7 @@ Details
122
126
}
123
127
124
128
case class Hello () { override def toString = " hello" }
129
+
130
+ object A {
131
+ override def equals (that : Any ) = that == " a"
132
+ }
You can’t perform that action at this time.
0 commit comments