Class: Test::Unit::Assertions::AssertionMessage::NumericInspector

Inherits:
Object
  • Object
show all
Defined in:
lib/test/unit/assertions.rb,
lib/test/unit/assertions.rb,
lib/test/unit/assertions.rb,
lib/test/unit/assertions.rb,
lib/test/unit/assertions.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(numeric, inspected_objects) ⇒ NumericInspector

Returns a new instance of NumericInspector



1852
1853
1854
1855
# File 'lib/test/unit/assertions.rb', line 1852

def initialize(numeric, inspected_objects)
  @inspected_objects = inspected_objects
  @numeric = numeric
end

Class Method Details

.target?(object) ⇒ Boolean

Returns:

  • (Boolean)


1847
1848
1849
# File 'lib/test/unit/assertions.rb', line 1847

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

Instance Method Details

#inspectObject



1857
1858
1859
# File 'lib/test/unit/assertions.rb', line 1857

def inspect
  @numeric.to_s
end

#pretty_print(q) ⇒ Object



1861
1862
1863
# File 'lib/test/unit/assertions.rb', line 1861

def pretty_print(q)
  q.text(@numeric.to_s)
end

#pretty_print_cycle(q) ⇒ Object



1865
1866
1867
# File 'lib/test/unit/assertions.rb', line 1865

def pretty_print_cycle(q)
  q.text(@numeric.to_s)
end