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



118
119
120
121
122
123
124
# File 'lib/action_controller/test_case.rb', line 118

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