Class: BladeRunner::CombinedTestResults
- Inherits:
-
Object
- Object
- BladeRunner::CombinedTestResults
- Defined in:
- lib/blade_runner/combined_test_results.rb
Instance Attribute Summary collapse
-
#all_test_results ⇒ Object
readonly
Returns the value of attribute all_test_results.
-
#sessions ⇒ Object
readonly
Returns the value of attribute sessions.
Instance Method Summary collapse
- #failed? ⇒ Boolean
-
#initialize(sessions) ⇒ CombinedTestResults
constructor
A new instance of CombinedTestResults.
- #lines(type = :results) ⇒ Object
- #to_s ⇒ Object
- #total ⇒ Object
Constructor Details
#initialize(sessions) ⇒ CombinedTestResults
Returns a new instance of CombinedTestResults.
4 5 6 7 |
# File 'lib/blade_runner/combined_test_results.rb', line 4 def initialize(sessions) @sessions = sessions @all_test_results = sessions.map(&:test_results) end |
Instance Attribute Details
#all_test_results ⇒ Object (readonly)
Returns the value of attribute all_test_results.
2 3 4 |
# File 'lib/blade_runner/combined_test_results.rb', line 2 def all_test_results @all_test_results end |
#sessions ⇒ Object (readonly)
Returns the value of attribute sessions.
2 3 4 |
# File 'lib/blade_runner/combined_test_results.rb', line 2 def sessions @sessions end |
Instance Method Details
#failed? ⇒ Boolean
26 27 28 |
# File 'lib/blade_runner/combined_test_results.rb', line 26 def failed? statuses.include?("failed") end |
#lines(type = :results) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/blade_runner/combined_test_results.rb', line 13 def lines(type = :results) sessions.flat_map do |session| session.test_results.send(type).map do |line| line.sub(/ok/, "ok [#{session}]") end end end |
#to_s ⇒ Object
21 22 23 24 |
# File 'lib/blade_runner/combined_test_results.rb', line 21 def to_s lines = ["1..#{total}"] + lines(:failures) + lines(:passes) lines.join("\n") end |
#total ⇒ Object
9 10 11 |
# File 'lib/blade_runner/combined_test_results.rb', line 9 def total sum(totals) end |