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 '>'