From a57c960b0c390ab4ab01dadcc30bfe9febffd3c5 Mon Sep 17 00:00:00 2001 From: Tatsuya Sato Date: Sun, 18 Oct 2026 01:06:32 +0900 Subject: [PATCH] Fix SimpleInspect#inspect(true) raising ArgumentError (#191) A bare `super` forwarded the `full` argument to Object#inspect, which takes none. Call `super()` explicitly. Co-Authored-By: Claude Opus 5.5 --- lib/docx/helpers.rb | 2 +- spec/docx/helpers_spec.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/docx/helpers.rb b/lib/docx/helpers.rb index 257845d..ef1a4af 100644 --- a/lib/docx/helpers.rb +++ b/lib/docx/helpers.rb @@ -4,7 +4,7 @@ module SimpleInspect # than the default inspect method. But you can still get the default inspect method by passing # true as the first argument. def inspect(full = false) - return(super) if full + return super() if full variable_values = instance_variables.map do |var| diff --git a/spec/docx/helpers_spec.rb b/spec/docx/helpers_spec.rb index 55608f1..83c8766 100644 --- a/spec/docx/helpers_spec.rb +++ b/spec/docx/helpers_spec.rb @@ -24,5 +24,10 @@ def initialize expect(object.inspect).to include(%(@long="#{'x' * 100}...)) expect(object.inspect.length).to be < 300 end + + # Regression test for #191 + it 'falls back to the default inspect when asked for the full output' do + expect(object.inspect(true)).to include('x' * 500) + end end end