Module: SuperDiff::RSpec::ObjectInspection::Inspectors

Defined in:
lib/super_diff/rspec/object_inspection/inspectors.rb,
lib/super_diff/rspec/object_inspection/inspectors/partial_hash.rb,
lib/super_diff/rspec/object_inspection/inspectors/partial_array.rb,
lib/super_diff/rspec/object_inspection/inspectors/partial_object.rb,
lib/super_diff/rspec/object_inspection/inspectors/collection_containing_exactly.rb

Constant Summary collapse

PartialHash =
SuperDiff::ObjectInspection::InspectionTree.new do
  add_text "#<a hash including ("

  nested do |aliased_matcher|
    insert_hash_inspection_of(
      aliased_matcher.expecteds.first,
      initial_break: nil,
    )
  end

  add_break
  add_text ")>"
end
PartialArray =
SuperDiff::ObjectInspection::InspectionTree.new do
  def self.applies_to?(object)
    SuperDiff::RSpec.partial_array?(object)
  end

  add_text "#<a collection including ("

  nested do |aliased_matcher|
    insert_array_inspection_of(aliased_matcher.expecteds)
  end

  add_break
  add_text ")>"
end
PartialObject =
SuperDiff::ObjectInspection::InspectionTree.new do
  add_text "#<an object having attributes ("

  nested do |aliased_matcher|
    insert_hash_inspection_of(
      aliased_matcher.expected,
      initial_break: nil,
    )
  end

  add_break
  add_text ")>"
end
CollectionContainingExactly =
SuperDiff::ObjectInspection::InspectionTree.new do
  add_text "#<a collection containing exactly ("

  nested do |aliased_matcher|
    insert_array_inspection_of(aliased_matcher.expected)
  end

  add_break
  add_text ")>"
end