Sha256: 9fda9990387e0c2bee66d9d09ae0a0c651b76503290ded31099bc37689f44d4e

Contents?: true

Size: 606 Bytes

Versions: 54

Compression:

Stored size: 606 Bytes

Contents

module RSpec
  module Matchers
    module BuiltIn
      class Satisfy
        def initialize(&block)
          @block = block
        end

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

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

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

        def description
          "satisfy block"
        end
      end
    end
  end
end

Version data entries

54 entries across 54 versions & 18 rubygems

Version Path
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/rspec-expectations-2.14.5/lib/rspec/matchers/built_in/satisfy.rb
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/gems/rspec-expectations-2.14.5/lib/rspec/matchers/built_in/satisfy.rb
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/rspec-expectations-2.14.5/lib/rspec/matchers/built_in/satisfy.rb
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/lib/rspec/matchers/built_in/satisfy.rb
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/lib/rspec/matchers/built_in/satisfy.rb
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/lib/rspec/matchers/built_in/satisfy.rb
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/lib/rspec/matchers/built_in/satisfy.rb
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/lib/rspec/matchers/built_in/satisfy.rb
opal-rspec-cj-0.4.4 vendor_lib/rspec/matchers/built_in/satisfy.rb
opal-rspec-0.4.3 vendor_lib/rspec/matchers/built_in/satisfy.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/rspec-expectations-2.14.5/lib/rspec/matchers/built_in/satisfy.rb
opal-rspec-0.4.2 vendor_lib/rspec/matchers/built_in/satisfy.rb
opal-rspec-0.4.1 vendor_lib/rspec/matchers/built_in/satisfy.rb
opal-rspec-0.4.0 vendor_lib/rspec/matchers/built_in/satisfy.rb
opal-rspec-0.4.0.beta4 vendor_lib/rspec/matchers/built_in/satisfy.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/rspec-expectations-2.13.0/lib/rspec/matchers/built_in/satisfy.rb
dxruby_rp5-0.0.4 spec/vendor/rspec-expectations-2.14.4/lib/rspec/matchers/built_in/satisfy.rb
rspec-expectations-2.14.5 lib/rspec/matchers/built_in/satisfy.rb
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/rspec-expectations-2.14.4/lib/rspec/matchers/built_in/satisfy.rb
mango-0.7.1 vendor/bundler/ruby/2.0.0/gems/rspec-expectations-2.14.4/lib/rspec/matchers/built_in/satisfy.rb