The standard library tests in the https://github.com/Shopify/liquid repo are more precise about the result they expect, since they actually compare the ruby objects themselves for equality. Instead, the specs generated from these tests case the result to a string before comparing to the expected cast result string. The casting is done using liquid, which has ambiguities about the actual type given the result of the string cast. For example, nil, "" and [] would all produce an empty string.