mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
Remove untested lint conditions
This commit is contained in:
parent
74d172b4f6
commit
01edebd37c
@ -36,16 +36,10 @@ module ActiveModel::Serializer::Lint
|
||||
def test_read_attribute_for_serialization
|
||||
assert_respond_to resource, :read_attribute_for_serialization, 'The resource should respond to read_attribute_for_serialization'
|
||||
actual_arity = resource.method(:read_attribute_for_serialization).arity
|
||||
if defined?(::Rubinius)
|
||||
# 1 for def read_attribute_for_serialization(name); end
|
||||
# -2 for alias :read_attribute_for_serialization :send for rbx because :shrug:
|
||||
assert_includes [1, -2], actual_arity, "expected #{actual_arity.inspect} to be 1 or -2"
|
||||
else
|
||||
# using absolute value since arity is:
|
||||
# 1 for def read_attribute_for_serialization(name); end
|
||||
# -1 for alias :read_attribute_for_serialization :send
|
||||
assert_includes [1, -1], actual_arity, "expected #{actual_arity.inspect} to be 1 or -1"
|
||||
end
|
||||
# using absolute value since arity is:
|
||||
# 1 for def read_attribute_for_serialization(name); end
|
||||
# -1 for alias :read_attribute_for_serialization :send
|
||||
assert_equal 1, actual_arity.abs, "expected #{actual_arity.inspect}.abs to be 1 or -1"
|
||||
end
|
||||
|
||||
# Passes if the object responds to <tt>as_json</tt> and if it takes
|
||||
@ -85,8 +79,7 @@ module ActiveModel::Serializer::Lint
|
||||
def test_cache_key
|
||||
assert_respond_to resource, :cache_key
|
||||
actual_arity = resource.method(:cache_key).arity
|
||||
assert_includes [-1, 0], actual_arity,
|
||||
"expected #{actual_arity.inspect} to be 0 or -1"
|
||||
assert_includes [-1, 0], actual_arity, "expected #{actual_arity.inspect} to be 0 or -1"
|
||||
end
|
||||
|
||||
# Passes if the object responds to <tt>updated_at</tt> and if it takes no
|
||||
|
||||
Loading…
Reference in New Issue
Block a user