Class: Toaster::TestResult
- Inherits:
-
Object
- Object
- Toaster::TestResult
- Defined in:
- lib/toaster/test/test_result.rb
Instance Attribute Summary collapse
-
#end_time ⇒ Object
Returns the value of attribute end_time.
-
#iterations ⇒ Object
readonly
Returns the value of attribute iterations.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
Instance Method Summary collapse
-
#initialize ⇒ TestResult
constructor
A new instance of TestResult.
- #new_iteration ⇒ Object
- #save(file_path) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ TestResult
Returns a new instance of TestResult.
48 49 50 51 |
# File 'lib/toaster/test/test_result.rb', line 48 def initialize @iterations = [] start_time = TimeStamp.now.to_i end |
Instance Attribute Details
#end_time ⇒ Object
Returns the value of attribute end_time.
47 48 49 |
# File 'lib/toaster/test/test_result.rb', line 47 def end_time @end_time end |
#iterations ⇒ Object (readonly)
Returns the value of attribute iterations.
46 47 48 |
# File 'lib/toaster/test/test_result.rb', line 46 def iterations @iterations end |
#start_time ⇒ Object
Returns the value of attribute start_time.
47 48 49 |
# File 'lib/toaster/test/test_result.rb', line 47 def start_time @start_time end |
Instance Method Details
#new_iteration ⇒ Object
53 54 55 56 57 |
# File 'lib/toaster/test/test_result.rb', line 53 def new_iteration() i = IterationResult.new() @iterations << i return i end |
#save(file_path) ⇒ Object
58 59 60 61 |
# File 'lib/toaster/test/test_result.rb', line 58 def save(file_path) content = to_s() Util.write(file_path, content, true) end |
#to_s ⇒ Object
63 64 65 66 67 68 69 70 71 |
# File 'lib/toaster/test/test_result.rb', line 63 def to_s result = "<genericTestResult>\n" @iterations.each do |i| result += i.to_s end result += "<startTime>#{start_time}</startTime>\n<finishTime>#{end_time}</finishTime>\n" result += "</genericTestResult>" return result end |