From 22d38d54751e3e23144d4b4e1fb8ed67626c89c8 Mon Sep 17 00:00:00 2001 From: aycabta Date: Wed, 24 Jun 2020 18:41:10 +0900 Subject: [PATCH] [ruby/irb] Add test_eval_object_without_inspect_method https://github.com/ruby/irb/commit/c0d9a26bce --- test/irb/test_context.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/irb/test_context.rb b/test/irb/test_context.rb index d03cc30c78..014280de22 100644 --- a/test/irb/test_context.rb +++ b/test/irb/test_context.rb @@ -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