Sha256: 0415c90c35c160bfcabb6977207b20dbd1efee3f1e27f26b710f9707da577d3f

Contents?: true

Size: 595 Bytes

Versions: 1

Compression:

Stored size: 595 Bytes

Contents

module RSpec
  module Matchers
    module BuiltIn
      class Satisfy
        include Composable

        def initialize(&block)
          @block = block
        end

        def matches?(actual, &block)
          @block = block if block
          @actual = actual
          @block.call(actual)
        end

        def failure_message
          "expected #{@actual} to satisfy block"
        end

        def failure_message_when_negated
          "expected #{@actual} not to satisfy block"
        end

        def description
          "satisfy block"
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspec-expectations-3.0.0.beta2 lib/rspec/matchers/built_in/satisfy.rb