[前][次][番号順一覧][スレッド一覧]

ruby-changes:62342

From: aycabta <ko1@a...>
Date: Wed, 22 Jul 2020 02:42:18 +0900 (JST)
Subject: [ruby-changes:62342] 22d38d5475 (master): [ruby/irb] Add test_eval_object_without_inspect_method

https://git.ruby-lang.org/ruby.git/commit/?id=22d38d5475

From 22d38d54751e3e23144d4b4e1fb8ed67626c89c8 Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Wed, 24 Jun 2020 18:41:10 +0900
Subject: [ruby/irb] Add test_eval_object_without_inspect_method

https://github.com/ruby/irb/commit/c0d9a26bce

diff --git a/test/irb/test_context.rb b/test/irb/test_context.rb
index d03cc30..014280d 100644
--- a/test/irb/test_context.rb
+++ b/test/irb/test_context.rb
@@ -98,6 +98,23 @@ module TestIRB https://github.com/ruby/ruby/blob/trunk/test/irb/test_context.rb#L98
       $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
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]