Running this code in the Test environment will result in a TypeError. `JsonPath.for(@object).gsub('$..*[?(@.category=="fiction")]') { |v| v }.to_hash`