class RSpec::Matchers::BuiltIn::Satisfy
@api private Provides the implementation for ‘satisfy`. Not intended to be instantiated directly.
Public Class Methods
# File rspec-expectations/lib/rspec/matchers/built_in/satisfy.rb, line 10 def initialize(description=nil, &block) @description = description @block = block end
Public Instance Methods
@private
# File rspec-expectations/lib/rspec/matchers/built_in/satisfy.rb, line 23 def description @description ||= "satisfy #{block_representation}" end
@api private @return [String]
# File rspec-expectations/lib/rspec/matchers/built_in/satisfy.rb, line 29 def failure_message "expected #{actual_formatted} to #{description}" end
@api private @return [String]
# File rspec-expectations/lib/rspec/matchers/built_in/satisfy.rb, line 35 def failure_message_when_negated "expected #{actual_formatted} not to #{description}" end
@private
# File rspec-expectations/lib/rspec/matchers/built_in/satisfy.rb, line 16 def matches?(actual, &block) @block = block if block @actual = actual @block.call(actual) end