mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parent
3f0b4665df
commit
d290a02bd7
2 changed files with 20 additions and 0 deletions
|
@ -574,6 +574,8 @@ module IRB
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
handle_exception(exc)
|
handle_exception(exc)
|
||||||
|
@context.workspace.local_variable_set(:_, exc)
|
||||||
|
exc = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -105,6 +105,24 @@ module TestIRB
|
||||||
$VERBOSE = verbose
|
$VERBOSE = verbose
|
||||||
end
|
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
|
def test_eval_object_without_inspect_method
|
||||||
verbose, $VERBOSE = $VERBOSE, nil
|
verbose, $VERBOSE = $VERBOSE, nil
|
||||||
all_assertions do |all|
|
all_assertions do |all|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue