diff options
Diffstat (limited to 'test/irb/test_context.rb')
-rw-r--r-- | test/irb/test_context.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/irb/test_context.rb b/test/irb/test_context.rb index 49495027c1..a32b1fc97a 100644 --- a/test/irb/test_context.rb +++ b/test/irb/test_context.rb @@ -105,6 +105,24 @@ module TestIRB $VERBOSE = verbose end + def test_eval_input_raise2x + input = TestInputMethod.new([ + "raise 'Foo'\n", + "raise 'Bar'\n", + "_\n", + ]) + irb = IRB::Irb.new(IRB::WorkSpace.new(Object.new), input) + out, err = capture_output do + irb.eval_input + end + assert_empty err + assert_pattern_list([ + :*, /\(irb\):1:in `<main>': Foo \(RuntimeError\)\n/, + :*, /\(irb\):2:in `<main>': Bar \(RuntimeError\)\n/, + :*, /#<RuntimeError: Bar>\n/, + ], out) + end + def test_eval_object_without_inspect_method verbose, $VERBOSE = $VERBOSE, nil all_assertions do |all| |