Sha256: 382912da7992a2adef5c3cafa881b4c66dae784d5b36048e82b731fe6150b549

Contents?: true

Size: 763 Bytes

Versions: 7207

Compression:

Stored size: 763 Bytes

Contents

module RSpec
  module Matchers
    module BuiltIn
      # @api private
      # Provides the implementation for `be_an_instance_of`.
      # Not intended to be instantiated directly.
      class BeAnInstanceOf < BaseMatcher
        # @api private
        # @return [String]
        def description
          "be an instance of #{expected}"
        end

      private

        def match(expected, actual)
          actual.instance_of?(expected)
        rescue NoMethodError
          raise ::ArgumentError, "The #{matcher_name} matcher requires that " \
                                 "the actual object responds to #instance_of? method " \
                                 "but a `NoMethodError` was encountered instead."
        end
      end
    end
  end
end

Version data entries

7,207 entries across 7,139 versions & 78 rubygems

Version Path
coresv_db_backup-0.1.0 vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb
tdiary-5.1.1 vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb
ruby-scheduler-0.1.3 vendor/ruby/2.7.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb
ruby-scheduler-0.1.3 vendor/ruby/2.6.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb
ruby-scheduler-0.1.2 vendor/ruby/2.6.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb
ruby-scheduler-0.1.0 vendor/ruby/2.6.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb
cloudsmith-api-0.49.21 vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb
cloudsmith-api-0.49.15 vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb
cloudsmith-api-0.49.13 vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb
cloudsmith-api-0.49.9 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb
mdap-0.1.0 vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb
husc-0.2.1 vendor/bundle/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb
husc-0.2.0 vendor/bundle/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb
husc-0.1.1 vendor/bundle/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb
husc-0.1.0 vendor/bundle/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.6/lib/rspec/matchers/built_in/be_instance_of.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/rspec-expectations-3.8.4/lib/rspec/matchers/built_in/be_instance_of.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb