Sha256: 382912da7992a2adef5c3cafa881b4c66dae784d5b36048e82b731fe6150b549

Contents?: true

Size: 763 Bytes

Versions: 7270

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,270 entries across 7,202 versions & 78 rubygems

Version Path
logstash-output-scalyr-0.1.3 vendor/bundle/jruby/2.5.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/be_instance_of.rb
tdiary-5.1.2 vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb
tdiary-5.1.2 vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/be_instance_of.rb
logstash-output-scalyr-0.1.2 vendor/bundle/jruby/2.5.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/be_instance_of.rb
logstash-output-scalyr-0.1.2 vendor/bundle/jruby/2.5.0/gems/rspec-expectations-3.8.4/lib/rspec/matchers/built_in/be_instance_of.rb
rentdynamics-0.2.0 .bundle/ruby/2.6.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/be_instance_of.rb
rentdynamics-0.2.0 .gems/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/be_instance_of.rb
rspec-expectations-3.9.2 lib/rspec/matchers/built_in/be_instance_of.rb
jscop-0.1.2 vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/be_instance_of.rb
talon_one-2.0.0 vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/be_instance_of.rb
talon_one-2.0.0 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/be_instance_of.rb
cloudsmith-api-0.49.118 vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/be_instance_of.rb
cloudsmith-api-0.49.98 vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/be_instance_of.rb
cloudsmith-api-0.49.94 vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb
pokedex-terminal-0.2.8 vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb
pokedex-terminal-0.2.7 vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb
pokedex-terminal-0.2.6 vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb
pokedex-terminal-0.2.5 vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb
pokedex-terminal-0.2.4 vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb
rspec-expectations-3.9.1 lib/rspec/matchers/built_in/be_instance_of.rb