Module: ActiveSupport::Testing::SetupAndTeardown
Relationships & Source Files | |
Namespace Children | |
Modules:
| |
Extension / Inclusion / Inheritance Descendants | |
Included In:
::ActionCable::Channel::TestCase ,
::ActionCable::Connection::TestCase ,
::ActionCable::TestCase ,
::ActionController::TestCase ,
::ActionDispatch::IntegrationTest ,
::ActionDispatch::SystemTestCase ,
::ActionMailbox::TestCase ,
::ActionMailer::TestCase ,
::ActionView::TestCase ,
::ActiveJob::TestCase ,
::ActiveSupport::TestCase ,
::Rails::Generators::TestCase
| |
Defined in: | activesupport/lib/active_support/testing/setup_and_teardown.rb |
Overview
Adds support for setup
and teardown
callbacks. These callbacks serve as a replacement to overwriting the #setup
and #teardown
methods of your ::ActiveSupport::TestCase
.
class ExampleTest < ActiveSupport::TestCase
setup do
# ...
end
teardown do
# ...
end
end
Class Method Summary
Instance Method Summary
- #after_teardown Internal use only
- #before_setup Internal use only
Class Method Details
.prepended(klass)
[ GitHub ]# File 'activesupport/lib/active_support/testing/setup_and_teardown.rb', line 21
def self.prepended(klass) klass.include ActiveSupport::Callbacks klass.define_callbacks :setup, :teardown klass.extend ClassMethods end
Instance Method Details
#after_teardown
This method is for internal use only.
[ GitHub ]
#before_setup
This method is for internal use only.
[ GitHub ]
# File 'activesupport/lib/active_support/testing/setup_and_teardown.rb', line 39
def before_setup # :nodoc: super run_callbacks :setup end