Various fixes

This commit is contained in:
Michael Miller 2022-03-26 00:12:37 -06:00
parent bbaa8816b8
commit 1199379833
No known key found for this signature in database
GPG key ID: AC78B32D30CE34A2
3 changed files with 40 additions and 32 deletions

View file

@ -4,7 +4,6 @@ require "./stub"
require "./stubbable"
require "./stubbed_name"
require "./unexpected_message"
require "./value_stub"
module Spectator
# Stands in for an object for testing that a SUT calls expected methods.
@ -77,6 +76,15 @@ module Spectator
def initialize(@stubs : Array(Stub) = [] of Stub)
end
# Compares against another object.
#
# Always returns false.
# This method exists as a workaround to provide an alternative to `Object#same?`,
# which only accepts a `Reference` or `Nil`.
def same?(other) : Bool
false
end
# Defines a stub to change the behavior of a method in this double.
#
# NOTE: Defining a stub for a method not defined in the double's type has no effect.