class RSpec::Matchers::BuiltIn::Satisfy
Not intended to be instantiated directly.
Provides the implementation for ‘satisfy`.
@api private
def block_representation
def block_representation if (block_snippet = extract_block_snippet) "expression `#{block_snippet}`" else 'block' end end
def block_representation
def block_representation 'block' end
def description
- Private: -
def description @description ||= "satisfy #{block_representation}" end
def extract_block_snippet
def extract_block_snippet return nil unless @block Expectations::BlockSnippetExtractor.try_extracting_single_line_body_of(@block, matcher_name) end
def failure_message
-
(String)
-
Other tags:
- Api: - private
def failure_message "expected #{actual_formatted} to #{description}" end
def failure_message_when_negated
-
(String)
-
Other tags:
- Api: - private
def failure_message_when_negated "expected #{actual_formatted} not to #{description}" end
def initialize(description=nil, &block)
def initialize(description=nil, &block) @description = description @block = block end
def matches?(actual, &block)
- Private: -
def matches?(actual, &block) @block = block if block @actual = actual @block.call(actual) end