class RSpec::Matchers::BuiltIn::BeAnInstanceOf
@api private Provides the implementation for ‘be_an_instance_of`. Not intended to be instantiated directly.
Public Instance Methods
Source
# File lib/rspec/matchers/built_in/be_instance_of.rb, line 10 def description "be an instance of #{expected}" end
@api private @return [String]
Private Instance Methods
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