Skip to content

Commit

Permalink
Add test_eval_object_without_inspect_method
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed Jun 24, 2020
1 parent ce6d53e commit c0d9a26
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/irb/test_context.rb
Expand Up @@ -98,6 +98,23 @@ def test_eval_input
$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
Expand Down

0 comments on commit c0d9a26

Please sign in to comment.