mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/irb] Add test_eval_object_without_inspect_method
https://github.com/ruby/irb/commit/c0d9a26bce
This commit is contained in:
parent
b40e925c92
commit
22d38d5475
1 changed files with 17 additions and 0 deletions
|
@ -98,6 +98,23 @@ module TestIRB
|
|||
$VERBOSE = verbose
|
||||
end
|
||||
|
||||
def test_eval_object_without_inspect_method
|
||||
verbose, $VERBOSE = $VERBOSE, nil
|
||||
input = TestInputMethod.new([
|
||||
"BasicObject.new\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([:*, /\(Object doesn't support #inspect\)/,
|
||||
:*, /=> \n/,
|
||||
/\s*/], out)
|
||||
ensure
|
||||
$VERBOSE = verbose
|
||||
end
|
||||
|
||||
def test_default_config
|
||||
assert_equal(true, @context.use_colorize?)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue