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

ruby-changes:67948

From: Nobuyoshi <ko1@a...>
Date: Sun, 12 Sep 2021 03:56:41 +0900 (JST)
Subject: [ruby-changes:67948] bbd105c445 (master): Exclude option_parser from Test::Unit::Runner#inspect

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

From bbd105c4453525b0b1d9838a2c6aad188549f86d Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sun, 12 Sep 2021 03:51:19 +0900
Subject: Exclude option_parser from Test::Unit::Runner#inspect

---
 tool/lib/test/unit.rb | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tool/lib/test/unit.rb b/tool/lib/test/unit.rb
index 0bb1377..6e4b643 100644
--- a/tool/lib/test/unit.rb
+++ b/tool/lib/test/unit.rb
@@ -1441,6 +1441,14 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit.rb#L1441
         end
       end
 
+      def inspect
+        "#<#{self.class.name}: " <<
+        instance_variables.filter_map do |var|
+          next if var == :@option_parser # too big
+          "#{var}=#{instance_variable_get(var).inspect}"
+        end.join(", ") << ">"
+      end
+
       ##
       # Top level driver, controls all output and filtering.
 
-- 
cgit v1.1


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

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