org.scalatest.mock

trait MockitoSugar

[source: org/scalatest/mock/MockitoSugar.scala]

trait MockitoSugar
extends AnyRef
Trait that provides some basic syntax sugar for Mockito.

Using the Mockito API directly, you create a mock with:

 val mockCollaborator = mock(classOf[Collaborator])
 

Using this trait, you can shorten that to:

 val mockCollaborator = mock[Collaborator]
 
Author
Bill Venners
Method Summary
def mock [T <: AnyRef](implicit manifest : scala.reflect.Manifest[T]) : T
Invokes the mock method on the Mockito companion object (i.e., the static mock method in Java class org.mockito.Mockitok).
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
def mock[T <: AnyRef](implicit manifest : scala.reflect.Manifest[T]) : T
Invokes the mock method on the Mockito companion object (i.e., the static mock method in Java class org.mockito.Mockitok).

Using the Mockito API directly, you create a mock with:

   val mockCollaborator = mock(classOf[Collaborator])
   

Using this method, you can shorten that to:

   val mockCollaborator = mock[Collaborator]
   


Copyright (C) 2001-2010 Artima, Inc. All rights reserved.