lib/mocktail/matchers/base.rb in mocktail-1.2.3 vs lib/mocktail/matchers/base.rb in mocktail-2.0.0
- old
+ new
@@ -1,18 +1,26 @@
module Mocktail::Matchers
class Base
+ extend T::Sig
+ extend T::Helpers
+
+ if Mocktail::TYPED && T::Private::RuntimeLevels.default_checked_level != :never
+
+ end
+
# Custom matchers can receive any args, kwargs, or block they want. Usually
# single-argument, though, so that's defaulted here and in #insepct
+
def initialize(expected)
@expected = expected
end
def self.matcher_name
- raise Mocktail::Error.new("The `matcher_name` class method must return a valid method name")
+ raise Mocktail::InvalidMatcherError.new("The `matcher_name` class method must return a valid method name")
end
def match?(actual)
- raise Mocktail::Error.new("Matchers must implement `match?(argument)`")
+ raise Mocktail::InvalidMatcherError.new("Matchers must implement `match?(argument)`")
end
def inspect
"#{self.class.matcher_name}(#{@expected.inspect})"
end