123456789_123456789_123456789_123456789_123456789_

Class: Test::Unit::Assertions::AssertionMessage::MaybeContainer

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

Class Method Summary

Instance Method Summary

Constructor Details

.new(value, &formatter) ⇒ MaybeContainer

[ GitHub ]

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

def initialize(value, &formatter)
  @value = value
  @formatter = formatter
end

Instance Method Details

#inspect

[ GitHub ]

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

def inspect
  if @value.is_a?(Array)
    values = @value.collect do |value|
      @formatter.call(AssertionMessage.convert(value))
    end
    "[#{values.join(', ')}]"
  else
    @formatter.call(AssertionMessage.convert(@value))
  end
end