Module: Grift::MinitestPlugin

Defined in:
lib/grift/minitest_plugin.rb

Overview

A plugin to clean up mocks after tests in Minitest. It is recommended that you include this plugin to avoid needing to cleanup the mocks after each test.

To setup the plugin for your tests, you should include the following code in your ‘test_helper`

class Minitest::Test
  include Grift::MinitestPlugin
end

Instance Method Summary collapse

Instance Method Details

#after_teardownGrift::MockStore

After each test restores all mocks with no watching.

Returns:



22
23
24
25
# File 'lib/grift/minitest_plugin.rb', line 22

def after_teardown
  super
  Grift.restore_all_mocks(watch: false)
end