Module: RSpec::Rails::SetupAndTeardownAdapter::ClassMethods Private
- Defined in:
- lib/rspec/rails/adapters.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Instance Method Summary (collapse)
-
- (Object) setup(*methods)
private
Wraps
setupcalls from within Rails' testing framework inbeforehooks. -
- (Object) teardown(*methods)
private
Wraps
teardowncalls from within Rails' testing framework inafterhooks.
Instance Method Details
- (Object) setup(*methods)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Wraps setup calls from within Rails' testing framework in before
hooks.
109 110 111 112 113 114 115 116 117 |
# File 'lib/rspec/rails/adapters.rb', line 109 def setup(*methods) methods.each do |method| if method.to_s =~ /^setup_(with_controller|fixtures|controller_request_and_response)$/ prepend_before { __send__ method } else before { __send__ method } end end end |
- (Object) teardown(*methods)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Wraps teardown calls from within Rails' testing framework in
after hooks.
123 124 125 |
# File 'lib/rspec/rails/adapters.rb', line 123 def teardown(*methods) methods.each { |method| after { __send__ method } } end |