Module: ActiveSupport::Testing::SetupAndTeardown::ForMiniTest

Defined in:
lib/active_support/testing/setup_and_teardown.rb

Instance Method Summary collapse

Instance Method Details

#run(runner) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/active_support/testing/setup_and_teardown.rb', line 20

def run(runner)
  result = '.'
  begin
    run_callbacks :setup
    result = super
  rescue Exception => e
    result = runner.puke(self.class, __name__, e)
  ensure
    begin
      run_callbacks :teardown, :enumerator => :reverse_each
    rescue Exception => e
      result = runner.puke(self.class, __name__, e)
    end
  end
  result
end