module ActiveModel::Serializer::Lint::Tests

def test_cache_key

It is not required unless caching is enabled.
is part of the (self-expiring) cache_key, which is used by the adapter.
cache_key returns a (self-expiring) unique key for the object, and

Fails otherwise.
arguments (Rails 4.0) or a splat (Rails 4.1+).
Passes if the object responds to cache_key and if it takes no
def test_cache_key
  assert_respond_to resource, :cache_key
  actual_arity = resource.method(:cache_key).arity
  # using absolute value since arity is:
  #   0 for Rails 4.1+, *timestamp_names
  #  -1 for Rails 4.0, no arguments
  assert_includes [-1, 0], actual_arity, "expected #{actual_arity.inspect} to be 0 or -1"
end