Skip to content

Commit 1588897

Browse files
make pointer to_ptr tests clearer
1 parent ecb9f9e commit 1588897

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/fiddle/test_pointer.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,10 @@ def test_to_ptr_with_int
166166
assert_equal ptr, Pointer[0]
167167
end
168168

169-
def test_to_ptr_with_num
169+
MimicInteger = Struct.new(:to_int)
170+
def test_to_ptr_with_int_coercion
170171
ptr = Pointer.new 0
171-
assert_equal ptr, Pointer[0.0]
172+
assert_equal ptr, Pointer[MimicInteger.new(0)]
172173
end
173174

174175
def test_equals

0 commit comments

Comments
 (0)