123456789_123456789_123456789_123456789_123456789_

Class: Test::Unit::Assertions::AssertionMessage::ArrayInspector

Relationships & Source Files
Inherits: Object
Defined in: lib/test/unit/assertions.rb

Class Method Summary

Instance Method Summary

Constructor Details

.new(array, inspected_objects) ⇒ ArrayInspector

[ GitHub ]

  
# File 'lib/test/unit/assertions.rb', line 1958

def initialize(array, inspected_objects)
  @inspected_objects = inspected_objects
  @array = array.collect do |element|
    Inspector.cached_new(element, @inspected_objects)
  end
end

Class Method Details

.target?(object) ⇒ Boolean

[ GitHub ]

  
# File 'lib/test/unit/assertions.rb', line 1953

def target?(object)
  object.is_a?(Array)
end

Instance Method Details

#each(&block)

[ GitHub ]

  
# File 'lib/test/unit/assertions.rb', line 1981

def each(&block)
  @array.each(&block)
end

#inspect

[ GitHub ]

  
# File 'lib/test/unit/assertions.rb', line 1965

def inspect
  @array.inspect
end

#pretty_print(q)

[ GitHub ]

  
# File 'lib/test/unit/assertions.rb', line 1969

def pretty_print(q)
  q.group(1, '[', ']') do
    q.seplist(self) do |v|
      q.pp(v)
    end
  end
end

#pretty_print_cycle(q)

[ GitHub ]

  
# File 'lib/test/unit/assertions.rb', line 1977

def pretty_print_cycle(q)
  @array.pretty_print_cycle(q)
end