Skip to content

Commit a182618

Browse files
author
Yohan Robert
committed
Merge pull request #1663 from bf4/followup_to_rails_40_removal
Remove untested lint conditions
2 parents 4f425fe + 01edebd commit a182618

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

lib/active_model/serializer/lint.rb

+5-12
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,10 @@ def test_serializable_hash
3636
def test_read_attribute_for_serialization
3737
assert_respond_to resource, :read_attribute_for_serialization, 'The resource should respond to read_attribute_for_serialization'
3838
actual_arity = resource.method(:read_attribute_for_serialization).arity
39-
if defined?(::Rubinius)
40-
# 1 for def read_attribute_for_serialization(name); end
41-
# -2 for alias :read_attribute_for_serialization :send for rbx because :shrug:
42-
assert_includes [1, -2], actual_arity, "expected #{actual_arity.inspect} to be 1 or -2"
43-
else
44-
# using absolute value since arity is:
45-
# 1 for def read_attribute_for_serialization(name); end
46-
# -1 for alias :read_attribute_for_serialization :send
47-
assert_includes [1, -1], actual_arity, "expected #{actual_arity.inspect} to be 1 or -1"
48-
end
39+
# using absolute value since arity is:
40+
# 1 for def read_attribute_for_serialization(name); end
41+
# -1 for alias :read_attribute_for_serialization :send
42+
assert_equal 1, actual_arity.abs, "expected #{actual_arity.inspect}.abs to be 1 or -1"
4943
end
5044

5145
# Passes if the object responds to <tt>as_json</tt> and if it takes
@@ -85,8 +79,7 @@ def test_to_json
8579
def test_cache_key
8680
assert_respond_to resource, :cache_key
8781
actual_arity = resource.method(:cache_key).arity
88-
assert_includes [-1, 0], actual_arity,
89-
"expected #{actual_arity.inspect} to be 0 or -1"
82+
assert_includes [-1, 0], actual_arity, "expected #{actual_arity.inspect} to be 0 or -1"
9083
end
9184

9285
# Passes if the object responds to <tt>updated_at</tt> and if it takes no

0 commit comments

Comments
 (0)