All Classes
-
All Classes Interface Summary Class Summary Enum Summary Exception Summary Annotation Types Summary Class Description AsyncConditions Alternative to class BlockingVariable(s) that allows to evaluate conditions in a thread other than the spec runner's thread(s).AutoAttach Automatically attaches detached mocksDetachedMockFactory
to a Specification.AutoAttachExtension AutoCleanup Automatically cleans up the object stored in the annotated field or property at the end of its life time.BlockingVariable<T> A statically typed variable whose get() method will block until some other thread has set a value with the set() method, or a timeout expires.ConfigurationException Thrown to indicate that there is a problem with Spock's configuration (file).ConfigurationObject ConfineMetaClassChanges Confines any changes made to the meta classes of the specified classes to the annotated scope.ConfineMetaClassChanges.Container DetachedMockFactory This factory allows the creations of mocks outside of aSpecification
, e.g., in a Spring configuration.DirectoryFixture Exceptions Execution Allows to set the execution mode.FailsWith Indicates that a feature method is expected to fail with the given exception.FileSystemFixture FileSystemFixture can be used to create temporary directories and files.HamcrestSupport Ignore Indicates that a specification or feature method should not be run.IgnoreIf Ignores the annotated spec, feature or selected iterations if the given condition holds.IgnoreIf.Container IgnoreRest Indicates that all feature methods except the ones carrying this annotation should be ignored.IncludeExcludeCriteria Configuration indicating which specs and methods should be included/excluded from a spec run.Isolated Allows the isolated execution of a Specification.Issue Indicates that a feature method or specification relates to one or more issues in an external issue tracking system.Issue.Container Jvm Provides information on the current JVM, such as its Java version.MockFactory Base interface for Java based mocks seeMockingApi
orDetachedMockFactory
for more examples.MockingApi Spock's mocking API primarily consists of the following factory methods: Mock() Creates a general-purpose test double that supports both stubbing and mocking. Stub() Creates a test double that supports stubbing but not mocking. Spy() Creates a test double that, by default, delegates all calls to a real object.MutableClock A mutable implementation ofClock
for testing purposes.Narrative Allows to attach a natural-language description to a spec.OperatingSystem Provides information on the current operating system, such as its name, version, and family.OperatingSystem.Family An operating system family.ParallelConfiguration PendingFeature Indicates that the feature is not fully implemented yet and should not be reported as error.PendingFeatureIf Marks the annotated feature or selected iterations asPendingFeature
if the given condition holds.PendingFeatureIf.Container PollingConditions Repeatedly evaluates one or more conditions until they are satisfied or a timeout has elapsed.Requires Ignores the annotated spec, feature or selected iterations unless the given condition holds.Requires.Container ResourceLock Allows to control access to a shared resource.ResourceLock.Container RestoreSystemProperties Saves system properties before the annotated feature method (including any setup and cleanup methods) gets run, and restores them afterwards.Retry Retries the given feature if an exception occurs during execution.Retry.Mode Rollup Indicates that iterations of a data-driven feature should not be made visible as separate features to the outside world (IDEs, reports, etc.) but as one atomic test.RunnerConfiguration Configuration settings for the spec runner.See One or more references to external information related to a specification or feature.See.Container Shared Indicates that a field is shared among all feature methods in a specification.Specification Base class for Spock specifications.Stepwise When applied to a spec, the annotation indicates that the spec's feature methods should be run sequentially in their declared order (even in the presence of a parallel spec runner), always starting from the first method.Subject Indicates which objects/classes are the subjects of a specification.Subject.Container Tag Tag.Container TempDir Generate a temp directory for test, and delete it after test.Timeout Indicates that the execution of a method should time out after the given duration has elapsed.Title Allows to attach a natural-language name to a spec.UnitilsSupport Activates Unitils support for a specification.Unroll Indicates that iterations of a data-driven feature should be made visible as separate features to the outside world (IDEs, reports, etc.).Use Activates one or more Groovy categories while the annotated spec method or class executes.Use.Container UseModules Activates Guice integration for a specification.UseModules.Container