Class: TestDiff::TestInfo
- Inherits:
-
Object
- Object
- TestDiff::TestInfo
- Includes:
- Comparable
- Defined in:
- lib/test_diff/test_info.rb
Overview
class used to hold infomation about the test
Constant Summary collapse
- FIXNUM_MAX =
(2**(0.size * 8 - 2) - 1)
Instance Attribute Summary collapse
-
#execution_time ⇒ Object
readonly
Returns the value of attribute execution_time.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #compare_execution_time ⇒ Object
-
#initialize(f, et) ⇒ TestInfo
constructor
A new instance of TestInfo.
Constructor Details
#initialize(f, et) ⇒ TestInfo
Returns a new instance of TestInfo.
9 10 11 12 |
# File 'lib/test_diff/test_info.rb', line 9 def initialize(f, et) @filename = f @execution_time = et end |
Instance Attribute Details
#execution_time ⇒ Object (readonly)
Returns the value of attribute execution_time.
6 7 8 |
# File 'lib/test_diff/test_info.rb', line 6 def execution_time @execution_time end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
6 7 8 |
# File 'lib/test_diff/test_info.rb', line 6 def filename @filename end |
Instance Method Details
#<=>(other) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/test_diff/test_info.rb', line 18 def <=>(other) if compare_execution_time == other.compare_execution_time filename <=> other.filename else compare_execution_time <=> other.compare_execution_time end end |
#compare_execution_time ⇒ Object
14 15 16 |
# File 'lib/test_diff/test_info.rb', line 14 def compare_execution_time @execution_time || FIXNUM_MAX end |