Inherited from Around
Inherited from DelayedInit
Inherited from Around
Inherited from Context
Inherited from Scope
Inherited from Scope
Inherited from MockFactoryBase
Inherited from context.MockContext
Inherited from AbstractMockFactoryBase
Inherited from Matchers
Inherited from MockFunctions
Inherited from Mock
Inherited from AnyRef
Inherited from Any
Fixture context that should be created per test-case basis
To use ScalaMock in Specs2 tests you can either:
Specification
with org.scalamock.specs2.IsolatedMockFactory to get isolated test cases orFixture contexts are more flexible and are recommened for complex test suites where single set of fixtures does not fit all test cases.
Basic usage
For simple test cases it's enough to run test case in new
MockContext
scope.Complex fixture contexts
When multiple test cases need to work with the same mocks (and more generally - the same fixtures: files, sockets, database connections, etc.) you can use fixture contexts.