class Spec::Example::Configuration
def mock_with(mock_framework)
end
config.mock_with MyMockFrameworkAdapter
Spec::Runner.configure do |config|
Once you've defined this module, you can pass that to mock_with:
verify_mocks_for_rspec).
guaranteed to run even if there are failures in
verify_mocks_for_rspec and teardown_mocks_for_rspec (this is
Example. After executing the #after methods, RSpec will then call
call setup_mocks_for_rspec before running anything else in each
These are your hooks into the lifecycle of a given example. RSpec will
teardown_mocks_for_rspec.
verify_mocks_for_rspec
setup_mocks_for_rspec
methods:
adapter. This is simply a module that responds to the following
To use any other mock framework, you'll have to provide your own
end
config.mock_with :rspec, :mocha, :flexmock, or :rr
Spec::Runner.configure do |config|
Chooses what mock framework to use. Example:
def mock_with(mock_framework) @mock_framework = case mock_framework when Symbol mock_framework_path(mock_framework.to_s) else mock_framework end end