From 4c282f3b1716333657f3344764c513476c34421b Mon Sep 17 00:00:00 2001 From: SamW Date: Thu, 23 Nov 2023 21:37:41 -0800 Subject: [PATCH] Small bugfix to have guaranteed print out instance variables --- lib/rbs/test/guaranteed.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/rbs/test/guaranteed.rb b/lib/rbs/test/guaranteed.rb index 4a1e34e6a..1406eff6f 100644 --- a/lib/rbs/test/guaranteed.rb +++ b/lib/rbs/test/guaranteed.rb @@ -10,8 +10,7 @@ module Inspect module_function def guaranteed_inspect(obj) obj.inspect - rescue NoMethodError => err - raise unless err.name == :inspect && EQUAL.bind_call(obj, err.receiver) + rescue NoMethodError INSPECT.bind_call(obj) end @@ -20,7 +19,7 @@ def inspect instance_variables.each_with_index do |variable, index| string.concat ', ' unless index.zero? - string.concat "#{variable}: #{guaranteed_inspect(variable)}" + string.concat "#{variable}: #{guaranteed_inspect(instance_variable_get(variable))}" end string.concat '>'