Generates unique names for mocks, stubs, and mock functions
Generates unique names for mocks, stubs, and mock functions
(Since version ) see corresponding Javadoc for more information.
Fixture context that should be created per test-case basis
To use ScalaMock in Specs2 tests you can either:
Specificationwith 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
MockContextscope.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.