Skip to content

Fix Utils.inspect and Utils.to_s to allow zero arguments - #2116

Open
shivaansh74 wants to merge 1 commit into
Shopify:mainfrom
shivaansh74:fix/issue-2107-utils-inspect
Open

Fix Utils.inspect and Utils.to_s to allow zero arguments#2116
shivaansh74 wants to merge 1 commit into
Shopify:mainfrom
shivaansh74:fix/issue-2107-utils-inspect

Conversation

@shivaansh74

Copy link
Copy Markdown

Fixes #2107

Problem

Calling Liquid::Utils.inspect or Liquid::Utils.to_s without arguments raised an ArgumentError instead of delegating to super (the default module inspect/to_s representation).

Solution

  • Updated Liquid::Utils.inspect and Liquid::Utils.to_s to accept variable arguments (*args).
  • When called with zero arguments, they call super, returning the module name representation.
  • When called with arguments, they preserve the existing object inspection and formatting behavior.
  • Added unit tests in test/unit/utils_unit_test.rb to verify zero-argument and object-argument behaviors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix Utils module to not expect arguments for inspect

1 participant