class RSpec::Matchers::BuiltIn::Satisfy

@api private Provides the implementation for `satisfy`. Not intended to be instantiated directly.

Attributes

description[R]

@private

Public Class Methods

new(description="satisfy block", &block) click to toggle source
# File lib/rspec/matchers/built_in/satisfy.rb, line 11
def initialize(description="satisfy block", &block)
  @description = description
  @block = block
end

Public Instance Methods

failure_message() click to toggle source

@api private @return [String]

# File lib/rspec/matchers/built_in/satisfy.rb, line 25
def failure_message
  "expected #{actual_formatted} to #{description}"
end
failure_message_when_negated() click to toggle source

@api private @return [String]

# File lib/rspec/matchers/built_in/satisfy.rb, line 31
def failure_message_when_negated
  "expected #{actual_formatted} not to #{description}"
end
matches?(actual, &block) click to toggle source

@private

# File lib/rspec/matchers/built_in/satisfy.rb, line 17
def matches?(actual, &block)
  @block = block if block
  @actual = actual
  @block.call(actual)
end