File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
test/junit/scala/tools/testing Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package testing
33
44import org .junit .Assert
55import Assert ._
6+ import scala .reflect .ClassTag
67import scala .runtime .ScalaRunTime .stringOf
78import scala .collection .{ GenIterable , IterableLike }
89import scala .collection .JavaConverters ._
@@ -40,15 +41,13 @@ object AssertUtil {
4041 * and that its message satisfies the `checkMessage` predicate.
4142 * Any other exception is propagated.
4243 */
43- def assertThrows [T <: Throwable ](body : => Any ,
44- checkMessage : String => Boolean = s => true )
45- (implicit manifest : Manifest [T ]): Unit = {
44+ def assertThrows [T <: Throwable : ClassTag ](body : => Any ,
45+ checkMessage : String => Boolean = s => true ): Unit = {
4646 try {
4747 body
4848 fail(" Expression did not throw!" )
4949 } catch {
50- case e : Throwable if (manifest.runtimeClass isAssignableFrom e.getClass) &&
51- checkMessage(e.getMessage) =>
50+ case e : T if checkMessage(e.getMessage) =>
5251 }
5352 }
5453
You can’t perform that action at this time.
0 commit comments