File tree 1 file changed +10
-5
lines changed
lib/active_model/serializer
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -36,11 +36,16 @@ def test_serializable_hash
36
36
# Typically, it is implemented by including ActiveModel::Serialization.
37
37
def test_read_attribute_for_serialization
38
38
assert_respond_to resource , :read_attribute_for_serialization , "The resource should respond to read_attribute_for_serialization"
39
- # using absolute value since arity is:
40
- # -1 for alias :read_attribute_for_serialization :send
41
- # 1 for def read_attribute_for_serialization(name); end
42
- expected_arity = 1
43
- assert_equal resource . method ( :read_attribute_for_serialization ) . arity . abs , expected_arity
39
+ actual_arity = resource . method ( :read_attribute_for_serialization ) . arity
40
+ if defined? ( ::Rubinius )
41
+ # using 1 and 2 as values for rbx because :shrug:
42
+ assert_includes [ 1 , 2 ] , actual_arity , "expected #{ actual_arity } to be 1 or 2"
43
+ else
44
+ # using absolute value since arity is:
45
+ # -1 for alias :read_attribute_for_serialization :send
46
+ # 1 for def read_attribute_for_serialization(name); end
47
+ assert_equal actual_arity . abs , 1
48
+ end
44
49
end
45
50
46
51
# Passes if the object responds to <tt>as_json</tt> and if it takes
You can’t perform that action at this time.
0 commit comments