diff options
author | aycabta <aycabta@gmail.com> | 2020-06-24 18:41:10 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2020-07-22 02:31:47 +0900 |
commit | 22d38d54751e3e23144d4b4e1fb8ed67626c89c8 (patch) | |
tree | 50b1e0a0b92d5c6599b7dc4d64cf3c6d50cb591a /test/irb | |
parent | b40e925c92753640ae05951fe9f69604b41fab32 (diff) |
[ruby/irb] Add test_eval_object_without_inspect_method
https://github.com/ruby/irb/commit/c0d9a26bce
Diffstat (limited to 'test/irb')
-rw-r--r-- | test/irb/test_context.rb | 17 |
1 files changed, 17 insertions, 0 deletions
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 |