diff options
| author | tomoya ishida <tomoyapenguin@gmail.com> | 2023-11-25 19:15:58 +0900 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2023-11-25 10:16:02 +0000 |
| commit | f6b292b5ca8b397b00cc4e82d8ae7ede8b09f25f (patch) | |
| tree | 91cfcdb200a82efab856e9aed82247b3985c3c72 /test | |
| parent | 68a03613d8f7ec173addbfbb3989045d8f639ec5 (diff) | |
[ruby/irb] Fix exception(backtrace=nil) prints nothing
(https://github.com/ruby/irb/pull/782)
https://github.com/ruby/irb/commit/fa9ecf9a5b
Diffstat (limited to 'test')
| -rw-r--r-- | test/irb/test_raise_exception.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/test/irb/test_raise_exception.rb b/test/irb/test_raise_exception.rb index 9ca534dba1..c373dd7335 100644 --- a/test/irb/test_raise_exception.rb +++ b/test/irb/test_raise_exception.rb @@ -7,11 +7,8 @@ module TestIRB class RaiseExceptionTest < TestCase def test_raise_exception_with_nil_backtrace 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/, []) - e = Exception.new("foo") - puts e.inspect - def e.backtrace; nil; end - raise e + assert_in_out_err(bundle_exec + %w[-rirb -W0 -e IRB.start(__FILE__) -- -f --], <<-IRB, /#<Exception: foo>/, []) + raise Exception.new("foo").tap {|e| def e.backtrace; nil; end } IRB end |
