Groovy Documentation

grails.plugin.spock
[Groovy] Class MvcSpec

java.lang.Object
  spock.lang.Specification
      grails.plugin.spock.UnitSpec
          grails.plugin.spock.MvcSpec

abstract class MvcSpec
extends UnitSpec

Support class for writing unit tests for controllers. Its main job is to mock the various properties and methods that Grails injects into controllers. By default it determines what controller to mock based on the name of the test, but this can be overridden by one of the constructors.

Authors:
Graeme Rocher
Peter Ledbrook


Field Summary
protected java.lang.Object webRequest

 
Fields inherited from class UnitSpec
errorsMap
 
Property Summary
java.lang.Object classUnderTest

java.lang.Object instanceUnderTest

 
Method Summary
java.lang.Object findClassUnderTestConventiallyBySuffix(java.lang.Object suffix)

java.lang.Object getMockFlash()

java.lang.Object getMockParams()

java.lang.Object getMockRequest()

java.lang.Object getMockResponse()

java.lang.Object getMockSession()

java.lang.Object getRenderArgs()

java.lang.Object initializeMvcMocking(java.lang.Class classUnderTest)

java.lang.Object provideMvcClassUnderTest()

void reset()

java.lang.Object setup()

java.lang.Object setupSpec()

 
Methods inherited from class UnitSpec
addConverters, cleanup, cleanupSpec, enableCascadingValidation, loadCodec, mockConfig, mockController, mockDomain, mockFor, mockForConstraintsTests, mockLogging, mockTagLib, registerMetaClass, setup, setupSpec
 

Field Detail

webRequest

protected java.lang.Object webRequest


 
Property Detail

classUnderTest

@Shared
java.lang.Object classUnderTest


instanceUnderTest

java.lang.Object instanceUnderTest


 
Method Detail

findClassUnderTestConventiallyBySuffix

java.lang.Object findClassUnderTestConventiallyBySuffix(java.lang.Object suffix)


getMockFlash

java.lang.Object getMockFlash()


getMockParams

java.lang.Object getMockParams()


getMockRequest

java.lang.Object getMockRequest()


getMockResponse

java.lang.Object getMockResponse()


getMockSession

java.lang.Object getMockSession()


getRenderArgs

java.lang.Object getRenderArgs()


initializeMvcMocking

java.lang.Object initializeMvcMocking(java.lang.Class classUnderTest)


provideMvcClassUnderTest

java.lang.Object provideMvcClassUnderTest()


reset

void reset()


setup

java.lang.Object setup()


setupSpec

java.lang.Object setupSpec()


 

Groovy Documentation