Class: RSpec::Support::ObjectFormatter::DescribableMatcherInspector Private

Inherits:
BaseInspector
  • Object
show all
Defined in:
lib/rspec/support/object_formatter.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary

Attributes inherited from BaseInspector

#formatter, #object

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseInspector

#pretty_print

Class Method Details

.can_inspect?(object) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


178
179
180
# File 'lib/rspec/support/object_formatter.rb', line 178

def self.can_inspect?(object)
  Support.is_a_matcher?(object) && object.respond_to?(:description)
end

Instance Method Details

#inspectObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



182
183
184
# File 'lib/rspec/support/object_formatter.rb', line 182

def inspect
  object.description
end