org.scalatest.Inside
See theInside companion trait
Companion object that facilitates the importing of the inside
construct as an alternative to mixing it in. One use case is to import the inside
construct so you can use it in the Scala interpreter:
$ scala -cp scalatest-1.8.jar Welcome to Scala version 2.9.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_29). Type in expressions to have them evaluated. Type :help for more information. scala> import org.scalatest._ import org.scalatest._ scala> import matchers.Matchers._ import matchers.Matchers._ scala> import Inside._ import Inside._ scala> inside (List(1, 2, 3)) { case List(x, y, z) => | y should equal (2) | } scala> inside (List(1, 2, 3)) { case List(x, y, z) => | x should equal (2) | } org.scalatest.TestFailedException: 1 did not equal 2, inside List(1, 2, 3) at org.scalatest.matchers.Matchers$class.newTestFailedException(Matchers.scala:150) at org.scalatest.matchers.Matchers$.newTestFailedException(Matchers.scala:2331) at org.scalatest.matchers.Matchers$ShouldMethodHelper$.shouldMatcher(Matchers.scala:873) ...
Attributes
Members list
In this article