Sha256: 2164285bfeff80447dca5e62cf2b6d12779862c44a6d3a57a561ee3297d258b8
Contents?: true
Size: 688 Bytes
Versions: 5
Compression:
Stored size: 688 Bytes
Contents
require 'test_helper' module ActionDispatch class ExceptionWrapperTest < ActiveSupport::TestCase class TestError < StandardError attr_reader :backtrace def initialize(*backtrace) @backtrace = backtrace end end test '#extract_sources fetches source fragments for every backtrace' do exc = TestError.new("/test/controller.rb:9 in 'index'") wrapper = ExceptionWrapper.new({}, exc) wrapper.expects(:source_fragment).with('/test/controller.rb', 9).returns('some code') assert_equal [{ code: 'some code', file: '/test/controller.rb', line_number: 9 }], wrapper.extract_sources end end end
Version data entries
5 entries across 5 versions & 1 rubygems