Class: Test::Unit::Assertions::AssertionMessage::MaybeContainer
- Inherits:
-
Object
- Object
- Test::Unit::Assertions::AssertionMessage::MaybeContainer
- Defined in:
- lib/test/unit/assertions.rb
Instance Method Summary collapse
-
#initialize(value, &formatter) ⇒ MaybeContainer
constructor
A new instance of MaybeContainer.
- #inspect ⇒ Object
Constructor Details
#initialize(value, &formatter) ⇒ MaybeContainer
2288 2289 2290 2291 |
# File 'lib/test/unit/assertions.rb', line 2288 def initialize(value, &formatter) @value = value @formatter = formatter end |
Instance Method Details
#inspect ⇒ Object
2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 |
# File 'lib/test/unit/assertions.rb', line 2293 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 |