Sha256: 382912da7992a2adef5c3cafa881b4c66dae784d5b36048e82b731fe6150b549

Contents?: true

Size: 763 Bytes

Versions: 6878

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

6,878 entries across 6,811 versions & 75 rubygems

Version Path
cybrid_api_organization_ruby-0.122.67 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/built_in/be_instance_of.rb
cybrid_api_id_ruby-0.122.67 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/built_in/be_instance_of.rb
cybrid_api_bank_ruby-0.122.66 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/built_in/be_instance_of.rb
cybrid_api_organization_ruby-0.122.66 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/built_in/be_instance_of.rb
cybrid_api_id_ruby-0.122.66 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/built_in/be_instance_of.rb
cybrid_api_id_ruby-0.122.65 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/built_in/be_instance_of.rb
cybrid_api_bank_ruby-0.122.65 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/built_in/be_instance_of.rb
cybrid_api_organization_ruby-0.122.65 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/built_in/be_instance_of.rb
cybrid_api_bank_ruby-0.122.64 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/built_in/be_instance_of.rb
cybrid_api_id_ruby-0.122.64 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/built_in/be_instance_of.rb
cybrid_api_organization_ruby-0.122.64 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/built_in/be_instance_of.rb
cybrid_api_id_ruby-0.122.60 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/built_in/be_instance_of.rb
cybrid_api_bank_ruby-0.122.60 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/built_in/be_instance_of.rb
cybrid_api_organization_ruby-0.122.60 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/built_in/be_instance_of.rb
cybrid_api_organization_ruby-0.122.59 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/built_in/be_instance_of.rb
cybrid_api_bank_ruby-0.122.59 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/built_in/be_instance_of.rb
cybrid_api_id_ruby-0.122.59 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/built_in/be_instance_of.rb
cybrid_api_bank_ruby-0.122.58 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/built_in/be_instance_of.rb
cybrid_api_organization_ruby-0.122.58 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/built_in/be_instance_of.rb
cybrid_api_id_ruby-0.122.58 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/built_in/be_instance_of.rb