Skip to content

Commit

Permalink
Remove untested lint conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
bf4 committed Apr 5, 2016
1 parent 74d172b commit 01edebd
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions lib/active_model/serializer/lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,10 @@ def test_serializable_hash
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
Expand Down Expand Up @@ -85,8 +79,7 @@ def test_to_json
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
Expand Down

0 comments on commit 01edebd

Please sign in to comment.