Module: ActionController::TestCase::Assertions

Included in:
Integration::Session, ActionController::TestCase, ActionView::TestCase
Defined in:
lib/action_controller/test_case.rb

Instance Method Summary collapse

Instance Method Details

#clean_backtrace(&block) ⇒ Object



113
114
115
116
117
118
119
# File 'lib/action_controller/test_case.rb', line 113

def clean_backtrace(&block)
  yield
rescue ActiveSupport::TestCase::Assertion => error
  framework_path = Regexp.new(File.expand_path("#{File.dirname(__FILE__)}/assertions"))
  error.backtrace.reject! { |line| File.expand_path(line) =~ framework_path }
  raise
end