Module: RSpec::Rails::SetupAndTeardownAdapter::ClassMethods
- Defined in:
- lib/rspec/rails/adapters.rb
Instance Method Summary collapse
-
#setup(*methods) ⇒ Object
private
Wraps
setup
calls from within Rails' testing framework inbefore
hooks. -
#teardown(*methods) ⇒ Object
private
Wraps
teardown
calls from within Rails' testing framework inafter
hooks.
Instance Method Details
#setup(*methods) ⇒ Object
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.
47 48 49 50 51 52 53 54 55 |
# File 'lib/rspec/rails/adapters.rb', line 47 def setup(*methods) methods.each do |method| if method.to_s =~ /^setup_(fixtures|controller_request_and_response)$/ prepend_before { send method } else before { send method } end end end |
#teardown(*methods) ⇒ Object
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.
61 62 63 |
# File 'lib/rspec/rails/adapters.rb', line 61 def teardown(*methods) methods.each { |method| after { send method } } end |