From e0d12e9d0d5b7d5463638010028e1e4e381ba19a Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Sat, 9 Nov 2019 22:32:49 -0700 Subject: [PATCH] Use class name instead of hash of type Hash of type could collide, though unlikely. --- src/spectator/mocks/registry.cr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/spectator/mocks/registry.cr b/src/spectator/mocks/registry.cr index 7e165ae..dbfaf49 100644 --- a/src/spectator/mocks/registry.cr +++ b/src/spectator/mocks/registry.cr @@ -2,7 +2,7 @@ module Spectator::Mocks module Registry extend self - alias Key = Tuple(UInt64, UInt64) + alias Key = Tuple(String, UInt64) private struct Entry getter stubs = Deque(MethodStub).new @@ -47,11 +47,11 @@ module Spectator::Mocks end private def unique_key(reference : Reference) - {reference.class.hash, reference.object_id} + {reference.class.name, reference.object_id} end private def unique_key(value : Value) - {value.class.hash, value.hash} + {value.class.name, value.hash} end end end