Why
Hello. 👋
The Liquid::Utils.inspect method expects an object argument but, when not given, it'll throw an ArgumentError. This violates the Liskov Substitution Principle becauseObject (superclass) does not require you pass in any arguments.
How
To fix, can the method signature be something like this?
self.inspect object = nil, seen = {}
This would allow object to be optional instead of requried.
Notes
I tried monkey patching with nil but ended up with different spec failures so not sure what the default expectation is here but this definitely causes specs to fail in CI when using SimpleCov 1.0.0. Although, when running locally, I could not recreate this.
Why
Hello. 👋
The
Liquid::Utils.inspectmethod expects anobjectargument but, when not given, it'll throw anArgumentError. This violates the Liskov Substitution Principle becauseObject(superclass) does not require you pass in any arguments.How
To fix, can the method signature be something like this?
This would allow
objectto be optional instead of requried.Notes
I tried monkey patching with
nilbut ended up with different spec failures so not sure what the default expectation is here but this definitely causes specs to fail in CI when using SimpleCov 1.0.0. Although, when running locally, I could not recreate this.