class RSpec::Matchers::Satisfy

Public Class Methods

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

Public Instance Methods

description() click to toggle source
# File lib/rspec/matchers/satisfy.rb, line 22
def description
  "satisfy block"
end
failure_message_for_should() click to toggle source
# File lib/rspec/matchers/satisfy.rb, line 14
def failure_message_for_should
  "expected #{@actual} to satisfy block"
end
failure_message_for_should_not() click to toggle source
# File lib/rspec/matchers/satisfy.rb, line 18
def failure_message_for_should_not
  "expected #{@actual} not to satisfy block"
end
matches?(actual, &block) click to toggle source
# File lib/rspec/matchers/satisfy.rb, line 8
def matches?(actual, &block)
  @block = block if block
  @actual = actual
  @block.call(actual)
end