Sha256: 5d87c78a304bc78ea36dc58b92d2da036e4ee83c07dcc547e2cf4c7982b407ce

Contents?: true

Size: 898 Bytes

Versions: 113

Compression:

Stored size: 898 Bytes

Contents

module RSpec
  module Matchers
    module BuiltIn
      # @api private
      # Provides the implementation for `satisfy`.
      # Not intended to be instantiated directly.
      class Satisfy < BaseMatcher
        # @private
        attr_reader :description

        def initialize(description="satisfy block", &block)
          @description = description
          @block = block
        end

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

        # @api private
        # @return [String]
        def failure_message
          "expected #{actual_formatted} to #{description}"
        end

        # @api private
        # @return [String]
        def failure_message_when_negated
          "expected #{actual_formatted} not to #{description}"
        end
      end
    end
  end
end

Version data entries

113 entries across 105 versions & 29 rubygems

Version Path
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/3.0.0/gems/rspec-expectations-3.5.0/lib/rspec/matchers/built_in/satisfy.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.5.0/lib/rspec/matchers/built_in/satisfy.rb
vagrant-unbundled-2.2.14.0 vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.5.0/lib/rspec/matchers/built_in/satisfy.rb
vagrant-unbundled-2.2.10.0 vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.5.0/lib/rspec/matchers/built_in/satisfy.rb
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.3.0/gems/rspec-expectations-3.5.0/lib/rspec/matchers/built_in/satisfy.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.3.0/gems/rspec-expectations-3.5.0/lib/rspec/matchers/built_in/satisfy.rb
vagrant-unbundled-2.2.9.0 vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.5.0/lib/rspec/matchers/built_in/satisfy.rb
vagrant-unbundled-2.2.8.0 vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.5.0/lib/rspec/matchers/built_in/satisfy.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.5.0/lib/rspec/matchers/built_in/satisfy.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.5.0/lib/rspec/matchers/built_in/satisfy.rb
vagrant-unbundled-2.2.6.2 vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.5.0/lib/rspec/matchers/built_in/satisfy.rb
vagrant-unbundled-2.2.6.1 vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.5.0/lib/rspec/matchers/built_in/satisfy.rb
vagrant-unbundled-2.2.6.0 vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.5.0/lib/rspec/matchers/built_in/satisfy.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.5.0/lib/rspec/matchers/built_in/satisfy.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.5.0/lib/rspec/matchers/built_in/satisfy.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.5.0/lib/rspec/matchers/built_in/satisfy.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.5.0/lib/rspec/matchers/built_in/satisfy.rb
vagrant-unbundled-2.2.3.0 vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.5.0/lib/rspec/matchers/built_in/satisfy.rb
vagrant-unbundled-2.2.2.0 vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.5.0/lib/rspec/matchers/built_in/satisfy.rb
vagrant-unbundled-2.2.0.0 vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.5.0/lib/rspec/matchers/built_in/satisfy.rb