class RSpec::Matchers::BuiltIn::BeAnInstanceOf

@api private Provides the implementation for `be_an_instance_of`. Not intended to be instantiated directly.

Public Instance Methods

description() click to toggle source

@api private @return [String]

# File lib/rspec/matchers/built_in/be_instance_of.rb, line 10
def description
  "be an instance of #{expected}"
end

Private Instance Methods

match(expected, actual) click to toggle source
# File lib/rspec/matchers/built_in/be_instance_of.rb, line 16
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