module RSpec::Rails::SetupAndTeardownAdapter::ClassMethods

Public Instance Methods

setup(*methods) click to toggle source

Wraps `setup` calls from within Rails' testing framework in `before` hooks.

# File lib/rspec/rails/adapters.rb, line 146
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
teardown(*methods) click to toggle source

@api private

Wraps `teardown` calls from within Rails' testing framework in `after` hooks.

# File lib/rspec/rails/adapters.rb, line 160
def teardown(*methods)
  methods.each { |method| after { __send__ method } }
end