2015-12-16 00:07:31 -05:00
|
|
|
# frozen_string_literal: false
|
2014-08-12 22:19:48 -04:00
|
|
|
require 'test/unit'
|
|
|
|
|
|
|
|
module TestIRB
|
|
|
|
class TestRaiseNoBacktraceException < Test::Unit::TestCase
|
|
|
|
def test_raise_exception
|
2019-06-12 11:29:45 -04:00
|
|
|
bundle_exec = ENV.key?('BUNDLE_GEMFILE') ? ['-rbundler/setup'] : []
|
|
|
|
assert_in_out_err(bundle_exec + %w[-rirb -W0 -e IRB.start(__FILE__) -- -f --], <<-IRB, /Exception: foo/, [])
|
2014-08-12 22:19:48 -04:00
|
|
|
e = Exception.new("foo")
|
2019-03-20 14:50:05 -04:00
|
|
|
puts e.inspect
|
2014-08-12 22:19:48 -04:00
|
|
|
def e.backtrace; nil; end
|
|
|
|
raise e
|
|
|
|
IRB
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|