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

Inherits:
Object
  • Object
show all
Defined in:
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.



1882
1883
1884
1885
# File 'lib/test/unit/assertions.rb', line 1882

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

Class Method Details

.target?(object) ⇒ Boolean

Returns:

  • (Boolean)


1877
1878
1879
# File 'lib/test/unit/assertions.rb', line 1877

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

Instance Method Details

#inspectObject



1887
1888
1889
# File 'lib/test/unit/assertions.rb', line 1887

def inspect
  @numeric.to_s
end

#pretty_print(q) ⇒ Object



1891
1892
1893
# File 'lib/test/unit/assertions.rb', line 1891

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

#pretty_print_cycle(q) ⇒ Object



1895
1896
1897
# File 'lib/test/unit/assertions.rb', line 1895

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