ScalaTest 1.1
|
|
object
AssertionsForJUnit
extends
AssertionsForJUnitAssertionsForJUnit
members as
an alternative to mixing it in. One use case is to import AssertionsForJUnit
members so you can use
them in the Scala interpreter:
$ scala -cp junit3.8.2/junit.jar:../target/jar_contents Welcome to Scala version 2.7.5.final (Java HotSpot(TM) Client VM, Java 1.5.0_16). Type in expressions to have them evaluated. Type :help for more information. scala> import org.scalatest.junit.AssertionsForJUnit._ import org.scalatest.junit.AssertionsForJUnit._ scala> assert(1 === 2) junit.framework.AssertionFailedError: 1 did not equal 2 at org.scalatest.junit.AssertionsForJUnit$class.assert(AssertionsForJUnit.scala:353) at org.scalatest.junit.AssertionsForJUnit$.assert(AssertionsForJUnit.scala:672) at .( :7) at . ( ) at RequestResult$. ( :3) at RequestResult$. ( ) at RequestResult$result( expect(3) { 1 + 3 } junit.framework.AssertionFailedError: Expected 3, but got 4 at org.scalatest.junit.AssertionsForJUnit$class.expect(AssertionsForJUnit.scala:563) at org.scalatest.junit.AssertionsForJUnit$.expect(AssertionsForJUnit.scala:672) at . ( :7) at . ( ) at RequestResult$. ( :3) at RequestResult$. ( ) at RequestResult$result( val caught = intercept[StringIndexOutOfBoundsException] { "hi".charAt(-1) } caught: StringIndexOutOfBoundsException = java.lang.StringIndexOutOfBoundsException: String index out of range: -1
Methods inherited from Assertions | |
assert, assert, assert, assert, convertToEqualizer, intercept, expect, expect, fail, fail, fail, fail |
Methods inherited from AnyRef | |
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
ScalaTest 1.1
|
|