class RR::WildcardMatchers::Satisfy

Attributes

expectation_proc[R]

Public Class Methods

new(expectation_proc) click to toggle source
# File lib/rr/wildcard_matchers/satisfy.rb, line 6
def initialize(expectation_proc)
  @expectation_proc = expectation_proc
end

Public Instance Methods

==(other) click to toggle source
# File lib/rr/wildcard_matchers/satisfy.rb, line 15
def ==(other)
  other.is_a?(self.class) &&
  other.expectation_proc.equal?(self.expectation_proc)
end
Also aliased as: eql?
eql?(other)
Alias for: ==
inspect() click to toggle source
# File lib/rr/wildcard_matchers/satisfy.rb, line 21
def inspect
  "satisfy { ... }"
end
wildcard_match?(other) click to toggle source
# File lib/rr/wildcard_matchers/satisfy.rb, line 10
def wildcard_match?(other)
  self == other ||
  !!expectation_proc.call(other)
end