diff --git a/src/spectator/mocks/generic_method_stub.cr b/src/spectator/mocks/generic_method_stub.cr index 0ac09ed..f695646 100644 --- a/src/spectator/mocks/generic_method_stub.cr +++ b/src/spectator/mocks/generic_method_stub.cr @@ -20,6 +20,10 @@ module Spectator::Mocks io << @args io << ')' end + io << " : " + io << ReturnType + io << " at " + io << @source end end end diff --git a/src/spectator/mocks/nil_method_stub.cr b/src/spectator/mocks/nil_method_stub.cr index 9a8954c..b0d087e 100644 --- a/src/spectator/mocks/nil_method_stub.cr +++ b/src/spectator/mocks/nil_method_stub.cr @@ -8,7 +8,7 @@ module Spectator::Mocks if (cast = nil.as?(RT)) cast else - raise "The return type of stub #{to_s} : Nil doesn't match the expected type #{RT}" + raise "The return type of stub #{self} doesn't match the expected type #{RT}" end end diff --git a/src/spectator/mocks/proc_method_stub.cr b/src/spectator/mocks/proc_method_stub.cr index 1960a04..98f9ca3 100644 --- a/src/spectator/mocks/proc_method_stub.cr +++ b/src/spectator/mocks/proc_method_stub.cr @@ -12,7 +12,7 @@ module Spectator::Mocks if (cast = result.as?(RT)) cast else - raise "The return type of stub #{to_s} : #{ReturnType} doesn't match the expected type #{RT}" + raise "The return type of stub #{self} doesn't match the expected type #{RT}" end end end diff --git a/src/spectator/mocks/value_method_stub.cr b/src/spectator/mocks/value_method_stub.cr index f1e989a..aef48d9 100644 --- a/src/spectator/mocks/value_method_stub.cr +++ b/src/spectator/mocks/value_method_stub.cr @@ -12,7 +12,7 @@ module Spectator::Mocks if (cast = result.as?(RT)) cast else - raise "The return type of stub #{to_s} : #{ReturnType} doesn't match the expected type #{RT}" + raise "The return type of stub #{self} doesn't match the expected type #{RT}" end end end